Dual Booting Windows and Linux

The ability to dual-boot operating systems is extremely handy when you need features of more than one operating system on a single computer. This capability is especially useful for IT folks since they often have to hack systems in different environments. I've found it useful to have a full install of Linux (Fedora 9) and Windows Vista when I want to experiment with or test something and am limited to just a laptop computer.
Since Windows Vista it's more of a pain to configure dual-booting even though Microsoft now provides an almost useless utility called, "bcdedit". Don't even bother with this, it only exists to make it more difficult to dual-boot into Linux and has no other discernible purpose. Download this alternative boot-manager: EasyBCD; it's so easy a caveman can do it.

What you're wanting to do is modify the boot sector on the primary hard disk so that the boot loader will look at the boot sector on a different partition or hard disk.

The boot loader will try to load instructions for what to boot and this is usually a single entry in the boot sector area of the disk. You can add other entries to force the boot loader to look elsewhere - outside the normal boot sector region on the first hard disk. All we want is to create that new pointer so the boot loader will load Linux from a different partition or disk.

Most sources I've seen suggest you load Windows first and then add Linux but you can do it the other way around if you like. The Windows setup will trash the existing boot sector and re-write it to boot only Windows so it will wipe out an existing Linux boot sector data. This is annoying but it's fixable. After Windows has taken over the boot sector you can use a boot-manager to add it back if you know where the Linux boot sector is. This will use the default Windows boot menu where you can select which operating system to load.

During the install of Linux you will also have the option to install the boot loader in some other place. You will even get a menu showing you what's already in the boot sector. Just add the Linux boot sector and choose whether it's the default boot target or not. This is another of those ways in which Linux is technically superior to any version of Windows. Use the grub boot loader and tell it where all the bootable operating systems are and the order they should appear in the boot menu. You can even change the names of the boot menu entries for clarity. To manipulate the Linux boot loader edit the /boot/grub/grub.com file (see this).

Since we have the grub boot loader available under Linux, you can have your Linux install take over the boot sector by telling it (during install is the best time) to install grub on the boot sector of the first drive. Since other operating systems are also detected you can include them. Now you won't need the Windows boot manager at all since grub is doing all the work. The boot menu you see at startup will be the grub boot manager, not Windows. After the Linux install you can edit the /boot/grub/grub.conf file and make changes if you know which disk or partitions contain the boot loader (see more on partitions, here). Linux uses its own notation that looks something like:

/dev/hda1
so that's how you'll have to specify it in the grub.conf file. You can also use the Linux version of fdisk to see how a disk is configured. If you have just one physical disk it will probably be something like /dev/hda with any partitions as numbers tacked on. to see how that disk is configured do:
fdisk /dev/hda
Hit "m" for the menu of options or "p" to display the partition information for that disk. You can tell what's where by the file system type. Vista will be NTFS and the bootable partition is C drive. The Linux partitions will probably be ext3. During the install of Linux, always create a 100Mb partition named, "boot" for the boot partition. It makes it easier to manage later. The best way to handle dual-booting, then, is to use grub but, if you want to do it from Windows, use a boot manager.

Return to Contents Page