Personal tools
You are here: Home Fedora Solved Post Install Solutions Dual Boot with Windows

Dual Boot with Windows

by daMaestro last modified Nov 07, 2009 08:36 PM

Some people still have a use to dual boot to windows. An example, playing video games or running other software that wont run using something like wine. This brief howto illustrates how to configure the grub boot loader to also be able to boot windows.

Applicable to Fedora Versions

  • All

Requirements

This howto covers configuring grub to boot windows. If you are using the ntldr as your default boot loader, see this post.
  1. BIOS set to boot to a device where grub is installed on the MBR.
  2. Working understanding of where your windows installation and Linux installations are on your hardware.

Doing the Work

Configuring grub is straightforward. Find the information you need and configuration is a breeze.

Windows Installed on the Primary Drive:

  1. Find out the hardware device and partition your windows is installed to:
    su -c "/sbin/fdisk -l"
    You will see output like the following, showing windows is installed onto the primary drive:
    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000877eb

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 3824 30716248+ 7 HPFS/NTFS
    /dev/sda2 3825 3837 104422+ 83 Linux
    /dev/sda3 3838 30401 213375330 8e Linux LVM
    In this case, windows is installed to /dev/sda1 and you can tell this from the "System" format of HPFS/NTFS.
  2. Find out the device id that grub uses: (make sure you search for the correct device, here we assume sda)
    grep sda /boot/grub/device.map
    You will see output like the following:
    (hd0)    /dev/sda
  3. Configure a grub entry to boot this device. Edit your /etc/grub.conf and add the following:
    title Windows
    rootnoverify (hd0,0)
    chainloader +1
    Note how the device to be booted is selected from the information you have gathered in step 1 and 2. We found out that sda is hd0 and that windows is installed to the first partition. The first partition to grub is 0 (yes, it's a zero index) and thus to boot /dev/sda1 the resulting device in grub-land is (hd0,0).
  4. Make sure you are aware of what grub entry is set as the default, counting from zero for each "title" entry. The first entry is normally the default (but can be configured with the default=N configuration option) so you will likely want to configure your windows boot option as the last entry.

Windows Installed on a non-Primary Drive:

  1. Find out the hardware device and partition your windows is installed to:
    su -c "/sbin/fdisk -l"
    You will see output like the following, showing windows is not installed onto the primary drive:
    Disk /dev/sdd: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000877eb

    Device Boot Start End Blocks Id System
    /dev/sdd1 * 1 3824 30716248+ 7 HPFS/NTFS
    /dev/sdd2 3825 3837 104422+ 83 Linux
    /dev/sdd3 3838 30401 213375330 8e Linux LVM
    In this case, windows is installed to /dev/sdd1 and you can tell this from the "System" format of HPFS/NTFS.
  2. Find out the device id that grub uses: (make sure you search for the correct device, here we assume sdd)
    grep sdd /boot/grub/device.map
    You will see output like the following:
    (hd2)    /dev/sdd
  3. Configure a grub entry to boot this device. Edit your /etc/grub.conf and add the following:
    title Windows
    map (hd2) (hd0)
    map (hd0) (hd2)
    rootnoverify (hd2,0)
    chainloader +1
    Note how the device to be booted is selected from the information you have gathered in step 1 and 2. We found out that sdd is hd2 and that windows is installed to the first partition. The first partition to grub is 0 (yes, it's a zero index) and thus to boot /dev/sdd1 the resulting device in grub-land is (hd2,0). Make sure to note, you must re-map your drives or NTLDR will not correctly boot. More information on this: here.
  4. Make sure you are aware of what grub entry is set as the default, counting from zero for each "title" entry. The first entry is normally the default (but can be configured with the default=N configuration option) so you will likely want to configure your windows boot option as the last entry.

Troubleshooting

How to test

Reboot and test booting into windows. When the grub splash screen shows up, use the arrow keys to select a different boot option.

Common problems and fixes

The default timeout might be too low for some people and you should configure the "timeout=N" where N is seconds to wait at the boot splash screen before the default entry is loaded.

More Information

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net

Added Reading

Document Actions
Log in


Forgot your password?
New user?