SETI Forum | Linux Forum

Site Navigation:

Get Firefox!


Dual Booting Linux and Windows using the Windows Boot Loader

This method uses the Windows boot loader to control the boot process and passes control to the Linux boot loader (either Lilo or GRUB) only if Linux is selected. This method works with Windows NT4/Win2K/XP (it will not work with Windows 9x/ME that does not have it's own boot loader, but instead boots from DOS). Windows should be installed first and it's boot loader will be written to the MBR. Linux is then installed to the remaining free space and it's boot loader is written to the root Linux partition, not the MBR. This method has been tested with both Lilo and GRUB Linux boot loaders and works with both. However, I recommend using the GRUB boot loader.


Due to recently highlighted differences in the way Windows and Linux read disk geometry and the partition table, I recommend taking the following precautions before beginning this process. Failure to do so may render your Windows partition inaccessible.

  • Set the hard disk access mode in your BIOS to LBA, not AUTO.
  • Try to ensure that bootable partitions do not cross the 1023 cylinder limit (approx 8GB). I recommend creating a 100MB /boot partition for Linux at the start of the disk and then a Windows system partition up to the 1023 cylinder limit. The rest of the disk may be partitioned as you choose.
  • If possible, when installing Linux pass the disk geometry to the installer during boot with linux hda=Cylinders,Heads,Sectors as described here.

First, install Windows. If you want to share files between Windows and Linux on your dual boot setup, I recommend you also set up a separate FAT32 partition for this. Linux fully supports FAT32 whereas support for NTFS is still experimental.

Next, install Linux. This is the important part: when installing the boot loader under Linux, you must install it to the root file system not the MBR (e.g. /dev/hdaXX, not /dev/hda, where XX is the partition number of the root file system). Make a note of the partition number (XX) as you'll need it in a moment and make sure you create a boot floppy when prompted during the install. If your Linux distribution does not support making a boot disk during the installation, make sure you create a boot disk before rebooting your Linux installation for the first time, or boot the computer using your distributions boot or rescue CD and either mount the file system or use the tools provided to create a boot floppy (see your distribution's documentation for details).


In case you missed that last bit, go back and read the last paragraph again!

After the install is complete, reboot the computer to Linux using the Linux boot floppy you created, log in as root and execute the following from a terminal (replacing the XX of hdaXX with the number of your Linux root partition):

dd if=/dev/hdaXX of=bootsect.lnx bs=512 count=1

This will copy the boot sector from your Linux root partition to a file in your root directory. Next we need to transfer this file to Windows, so Insert an MS-DOS formatted floppy and:

mount -t msdos /dev/fd0 /mnt
cp bootsect.lnx /mnt
umount /mnt

Remove the floppy and reboot the computer (shutdown -r now). Let Windows boot, open a command shell window and do:

attrib -r -s -h boot.ini
edit boot.ini


It is important to use edit to edit this file, not windows notepad or write.

Add a line at the bottom of the file as shown and save:

C:\bootsect.lnx "My New Linux Distro"

and reset the attributes:

attrib +r +s +h boot.ini

Finally, insert your MS-DOS formatted floppy and copy bootsect.lnx to C:\

Now reboot the computer and the Windows boot loader will control the boot process and give you the option to boot either Windows (default) or pass control to your new Linux Installation's boot loader.

If you wish to remove or uninstall Linux at any point in the future, all you need to do is delete C:\bootsect.lnx, remove the entry from C:\boot.ini and delete any Linux partitions.


If you use Lilo as your Linux boot loader, you must rerun Lilo to update your boot options, for example, after installing a new kernel. You must also recopy your Linux boot sector to Windows after doing this otherwise Lilo may fail to boot. This is not necessary when using GRUB and it is for this reason that I recommend using GRUB as your Linux boot loader.

Please check out my new site,, offering IT consultancy in Pembrokeshire. We specialize in spam-free email hosting and other custom Linux solutions.