My personal desktop system is comprised of two separate operating systems. I dual boot between these.
Note, depending on how GRUB is configured on your system, your configuration file might be menu.lst, or grub.conf. These files are normally located in /boot, and are the ones that need to be edited for this guide.
2x 160 GB Seagate Barracuda Hard Disks in a software RAID-1 setup for Ubuntu Linux.
1x 80GB Western Digital Special Edition Hard Disk for Windows XP Media Center Edition.
Windows has its own bootloader called NTLDR that it uses.
Linux by today’s standards will use GRUB (instead of LILO).
There is no need to replace NTLDR at all. Some have even gotten NTLDR to boot Linux by copying off the first 512 bytes off of their Linux partition. There have also been some reports of problems with people who replace NTLDR and have complaining virus scanners. So its probably a good idea to leave it intact and alone.
We’ll cover GRUB here, since a lot of people like using it to boot.
Normally, dual booting is very simple if you have both Linux and Windows on the same disk (you simply specify the options in /boot/grub/menu.lst as such):
# The normal way to do it with Windows on the same disk
title Microsoft Windows XP
Where hd0 (/dev/sda) is the disk (you have to guess — more on that in a minute), and partition 2 (which is /dev/sda2 in `fdisk -l`).
It is a little different when you have Windows on a separate disk alltogether. My hard disks were setup as follows.
IDE Channel 0:
Seagate 160GB (Master)
Seagate 160GB (Slave)
IDE Channel 1:
CD/DVD Drive (Master)
Western Digital 80GB (Slave)
Now, GRUB numberings (hdX,X), are very different than what you will see in `fdisk -l`. I spent quite a bit of time wondering why (hd2,0) wouldn’t boot into Windows.
Update: Don’t want to go through the pain of partition hunt and peck? Try some of this Ruby code.
To figure out which one is your Windows partition, go through on the GRUB menu (by rebooting) and get a `c`ommand shell.
Try root(hd0,0) incrementing all the way up to 7 (hd0,1) (hd0,2) (hd0,3)..and see if you get something on the lines of “unknown, partition type 0x7.”
If you don’t, move on to the next disk until you get it, or an error message telling you that the disk doesn’t exist. (hd1,0) (hd1,1)..
When you get a partition type of 0x7, thats Windows NTFS.
The rest from here is simple. Windows will need be told that it is on the master hard disk, so that Windows will work properly (there are some reports of problems without this for some reason).
This is fairly easy in GRUB. Insert the following:
# For Windows thats on another disk
# (Replace ‘(hd1)’ with the drive that Windows is on for you)
# You may also want to put this at the bottom, since some automated grub editors will overwrite this entry when they’re used
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
Save, and reboot.
Parts derived from UbuntuGuide.org and other sources.