Booting Linux and other Unices using the Windows 2000 Boot Menu

First off, this tutorial is basically for people for whom GRUB/LILO don't work for some reason. Otherwise, GRUB/LILO are your best options for a dual boot system. Another situation where this info might be useful is if you've installed a UNIX that doesn't come with a boot loader and you need to boot it from hard disk (ie without a boot floppy).

Now, here are the steps you need to take:

1) When you install Linux, tell the installer to install LILO/GRUB into the first sector of the root partition and NOT the MBR. This is VERY important.

2) When you install the Linux system, be sure to make a boot floppy. Advanced users who know what they're doing can also use a rescue disk or any live distribution.

3) After you install Linux, boot your system using the boot floppy. You might have to change the boot sequence in the BIOS to get this to work.

4) Login to Linux as root and type in the following commands (Please note that the hash (#) is not part of the command. It's the bash prompt) :

(i) # fdisk -l

This should bring up a list of partitions that looks something like this:

# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 4865 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1436 11534638+ 7 HPFS/NTFS
/dev/hda2 1437 1956 4173435 c Win95 FAT32 (LBA)
/dev/hda3 1956 4865 23370007+ f Win95 Ext'd (LBA)
/dev/hda5 1956 3521 12574296 c Win95 FAT32 (LBA)
/dev/hda6 3522 4541 8193118+ 83 Linux
/dev/hda7 4542 4607 530113+ 82 Linux swap
/dev/hda8 4608 4865 2072353+ b Win95 FAT32
Now in my case, the Linux partition is /dev/hda6 . Take a note of which partition is your Linux partition and keep it in mind. Now, if you have one or more FAT32 partitions, follow the instructions immediately below. If you don't have a FAT32 partition, just NTFS ones, then you read the following section and look at the notes at the end of the tutorial for floppy users.

(ii) Now, I have a FAT32 partition at /dev/hda5 . Now, I'll mount the FAT32 partition so that I can transfer files from the Linux partition to the FAT32 one. For that, use the following commands, replacing /dev/hda5 with your FAT32 partition and /dev/hda7 with your linux partition.

# mkdir /mnt/hda5
# mount -t vfat /dev/hda5 /mnt/hda5
Now do an ls /mnt/hda5 to make sure that the partition has been mounted successfully. You should get a listing of all the files on that partition.

(iii) Now comes the interesting stuff. Type this in exactly as I've written here (substituting the appropriate drive names of course), otherwise you could mess up your system.

# dd if = /dev/hda7 of=/mnt/hda5/boot.lin bs=512 count=1
It should respond with
1+0 records in
1+0 records out
or something similar

(iv) Now, reboot your computer into Windows 2K/XP, log in as Administrator (or equivalent) , and open the run dialog and type in "notepad c:\boot.ini". If this doesn't work then you'll have to change the attributes of the boot.ini file to make it visible (not hidden). You should get a file that looks something like this:

[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
To the end of the file, add a line that says:
C:\boot.lin="Linux"
"Linux" can be replaced with anything you like (Mine says c:\boot.lnx="Slackware Linux 8.1"). Save the file and exit notepad.

Now, go to the FAT32 partition that has the boot.lin file and copy it to C:\

That's it! Now reboot your computer and see the Win2K boot menu showing Linux as an option.

Note for people without a FAT32 partition:
Insert a DOS formatted floppy into your floppy drive and type in the following:
# mount /mnt/floppy

After you do this, just replace /dev/hda5/ with /mnt/floppy/ in all the commands.

If you have any questions, feel free to ask here or in PM.

Cheers,
cgkanchi