Thursday, November 15, 2007

Booting Linux with the NT Bootloader

In order to get this to work, you need to skip the installation of the bootloader during the install of Linux. I suggest just creating a boot floppy (you should always do this anyway). After the installation, assuming that lilo is installed, you then need to edit /etc/lilo.conf. The main thing here is that you choose to install lilo to your linux parition and not the hard drive. Assuming Linux is on the second partition on /dev/hda, your lilo config would be:

## 2.6.9 kernel

Make sure you do not select boot=/dev/hda here or else your windows bootloader is gone (you can get it back with the recovery console on XP or 2000; click for details; or with an ME or 98 startup disk on ME or 98; click for details;). Now you need to run lilo so it installs itself.

# /sbin/lilo

After you have installed lilo, you need to peel the boot sector off and save it to a floppy so you can copy it to windows. First off, mount the floppy.

# mount -t msdos /dev/fd0 /mnt/floppy

Now to peel the first 512 bytes of the boot sector and copy it to the floppy.

# dd if=/dev/hda5 of=/mnt/floppy/boot.lnx bs=512 count=1

Now reboot into your windows installation. Copy the file from the floppy to the C:\ partition. Then add C:\boot.lnx="Your Description for Linux" to the C:\boot.ini. It will look something like:

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Pro" /fastdetect
c:\boot.lnx="Slackware Linux v9.1"

Now reboot and test your work. You should now be able to easily dual boot your windows and penguin. This website was referenced in writing this article. I just added the full explanation of the lilo configuration.

No comments: