xp and 7 dual boot currently - replace xp with linux? don't harm 7
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
xp and 7 dual boot currently - replace xp with linux? don't harm 7
my desktop has dual boot of xp and 7 with xp boot manager controlling which gets booted.
I never use the xp partition anymore and it was forever-ago that I set this up or done anything messing around with dual booting etc. I'd like to use linux more on my desktop, but I don't want to touch my 7 partition. I'd like to use the get rid of the xp and replace it with some flavor of linux (prob arch) and leave my 7 as is.
I'm unsure of how to proceed seeing as I really don't want to disrupt/harm my 7 install, but the boot manager is xp and I'm a noob about setting up linux. my laptop is dual ubuntu and 7 with grub managing boot, but i set that up even longer ago and don't remember what i did, but i remember having to do something weird because of how win7 and grub being weird or something.
the worry of hosing up my 7 install freezes me from starting...any guidance would be greatly appreciated.
I suppose that xp's boot loader is on the master boot record or MBR.
If that is the case you just have to put your Linux' boot loader on your Linux root partition. This will left your MBR untouched.
With lilo that's a matter of:
- checking your partition's names and usage
- choose which will be your Linux root partition and make it bootable with cfdisk or fdisk
- make all other partitions not bootable
- tell lilo to put the boot loader on your Linux root partition.
For instance if /dev/sda3 is your Linux root partition you will include following line:
Code:
boot = /dev/sda3
in the global section of /etc/lilo.conf before running lilo.
This assume that /etc/fstab include following line:
Code:
/dev/sda3 / ext4 defaults 1 1
If your root partition's filesystem is not ext4, adapt accordingly.
I don't know grub but I suppose that you can do something similar with it.
Of course at time of Linux installation you will have make sure not to format your W7 partitions.
If really you are a noob in setting up linux I'm not sure that arch be the best choice, unless you accept to make a lot of reading before installing it. I can be wrong on that though and hope that this remark won't trigger another flame war
Last edited by Didier Spaier; 06-13-2012 at 06:42 PM.
You haven't given any detailed information so it's hard to make suggestions. I assume you manually configured the xp bootloader and edited the boot.ini file to create an entry for windows 7 after you installed, is that correct? Windows bootloaders are backward compatible but you will find at windows sites that you are always instructed to install the newer system last so the older system is detected. If you are not going to be using xp any longer, you will need to put windows 7 bootloader in the mbr. Apparently, there is some boot repair option with windows 7, either in the installation or on the installation DVD. You could try googling reinstalling windows 7 to mbr.
After that you will just need to get partition information for your hard drive to see which partition(s) windows is on so you don't accidentally install Linux to the same partition. You might also check your windows 7 partition to make sure the boot files are there and to verify that it is on a primary partition. You will then have the option to install Grub to the mbr for your Linux and it should create an entry for windows 7. If you want to boot from the windows 7 bootloader, you will need to manually configure or use something like EasyBCD.
You might google bootinfoscript, read the instructions and download it and run it after you have picked a Linux distro. You could do this from any Linux Live CD. This will give you a lot of information on drives/partitions and boot files.
It does not matter where you will install GRUB loader, at MBR or root partition. Anyway GRUB will found and add existing Windows installation into his boot menu.
If you not sure, just save your MBR backup before. You can boot from any linux liveCD and do this to get backup of your MBR:
dd if=/dev/sdX of=/path/to/where/store/it/mbr.backup bs=512 count=1
If something go wrong you can restore you MBR (and old windows boot menu) in this manner:
dd if=/path/to/where/store/it/mbr.backup of=/dev/sdX bs=512 count=1
These commands must be run as root (su or sudo). sdX must be replaced with correct value. You can get it by running (also as root):
fdisk -l
This command shows partitions list for all harddrives installed in your pc. It will be something like sda or sdb. Just 3 letters, without digit appended. It's important.
Also /path/to/where/store/it/ must be the safe place that wouldn't be formatted during installation (may be flash drive or existing win7 partition. For example: /dev/sdc1/mbr.backup
sorry i think its actually the win7 boot loader, when i boot it says "7" or "earlier version" of windows are my options.
thanks for the easybcd suggestion, i looked into that a little. seems lie i should just wipe the xp partition to unallocated space using win7 computer management (disk management) so I'll have my win7 partition, then the leftover allocated space, then proceed with a linux install in the unallocated space.
I want to use arch to get more experience learning command line and building up a custom system, not so much user friendly stuff. I've used arch before, but i just installed it on a whole disk and used the "auto" partition option during setup.
maybe this is better served in the arch forum, but does anyone know how arch will do the boot loader for a custom partition option during install? will it install grub over windows mbr? I can't remember if it gives you the option of where to install grub, but if I just keep it on that linux partition, couldn't i complete the install, then when i boot, the pc should just go right into windows 7 like there was no linux partition, then i can use the easybcd to overwrite the mbr with win7 boot loader with a linux option (that i'd assume it could recognize if i've already installed arch in the unallocated space)?
if I just let grub rip on the mbr, it should be able to tell there's a win7 partition and add that as a boot option no?
With wins 7 installed to most likely partition sda3 you may have to use a wins recovery disk because when you remove wins xp the partition numbers will change.
Use a linux live cd & postoutput of
It actually matters quite a lot what you choose to do. It is *not* just a matter of which loader code is in the MBR.
If you wipe out the XP partition, you will (very) likely not be able to boot Win7 at all. M$oft update the "current" boot partition when "dual-boot" installing a later system.
Go here, do as it says and post the RESULTS.txt it generates. That way we can see all the boot architecture, and save the guesswork.
Boot Info Script 0.61 [1 April 2012]
============================= Boot Info Summary: ===============================
=> Windows is installed in the MBR of /dev/sda.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files: /boot.ini /bootmgr /Boot/BCD /ntldr /NTDETECT.COM
sda2: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 * 63 168,007,769 168,007,707 7 NTFS / exFAT / HPFS
/dev/sda2 168,007,770 1,889,243,999 1,721,236,230 7 NTFS / exFAT / HPFS
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/cloop0 iso9660 KNOPPIX_FS
/dev/sda1 FA50196B50192FBD ntfs
/dev/sda2 1AB939505F833102 ntfs
/dev/sr0 iso9660 KNOPPIX
/dev/zram0 92f8eaab-b191-4649-a728-a5171e25f388 swap
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/cloop /KNOPPIX iso9660 (ro,relatime)
/dev/sr0 /mnt-system iso9660 (ro,relatime)
================================ sda1/boot.ini: ================================
--------------------------------------------------------------------------------
;
;Warning: Boot.ini is used on Windows XP and earlier operating systems.
;Warning: Use BCDEDIT.exe to modify Windows Vista boot options.
;
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /NOEXECUTE=OPTIN /FASTDETECT
--------------------------------------------------------------------------------
========= Devices which don't seem to have a corresponding hard drive: =========
sdb sdc sdd sde sdf sdg sdh
=============================== StdErr Messages: ===============================
No volume groups found
mdadm: No arrays found in config file or automatically
Either system you choose to delete you will have to repair.
If windows 7 is on sda2 & you delete sda1, sda2 will become sda1 meaning that windows 7 will not be mapped the same.
you can probably use windows disk to repair, but in my case I had to do a repair installation which b acks up your files but then you'll have to restore them yourself.
I haven't used arch before so cannot comment on it, but why don't you first try something that comes with a very good installer like Ubuntu or Mint. I've used both and the installer is very good and you don't have to do much. Just run it and as long as you choose the right partition to install, everything will go smoothly.
The mint installer for example (a slightly older version because I don't use the current one, but I don't think they've changed it much) first asks you to choose which partition you want to install in. You then choose where to install grub (it's mostly /dev/sda) and will overwrite your windows MBR.
This is however not an issue because grub will find and add your win7 install to it.
Just make sure that you choose your XP partition because the installation will overwrite whatever is existing in the partition. apart from that there's very little to do and almost zero errors.
Just to be on the safe side, clone your current win7 install so you'll have a backup.
Even if the OP uses the installer the fraction of a second that it takes to delete sda1 or C It will change sda2 or D to sda1, displacing windows7.
Is it really necessary to delete partition? OP can install linux without deleting any partitions, just using existing sda1 as root for installing linux. Of course sda1 must be formatted as ext3 or ext4.
There is no need to change the partitions order.
Just shrink sda2 for new swap area. It can be done with existing win7 tools.
Note that the BCD is in the XP partition - even though XP never knew of a BCD.
I'm sure you could delete/erase the XP partition and rebuild the BCD into the Win7 partition, but you'd need to ensure this was done and bootable prior to installing a Linux into /dev/sda1.
I've not tested this - and am not inclined to, as I have little to do with Windoze these days.
I just had a thought!
If you have another computer or an external drive, you can save an image of windows7 partition using clonezilla install your linux system & then restore wins7 to sda2.
After restoration go back to linux & update-grub.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.