Linux from the NT boot loader
I have a simple way for booting
Linux from the NT boot loader.
My machine has the following
/dev/hda1 VFAT 1 Gig
/dev/hda5 NTFS 2 Gig
/dev/hdb1 ex2fs 500 Meg.
I initially installed Windows 95 /dev/hda1
on and then NT onto
/dev/hda5 partition. I could then boot
into NT or 95 using the NT boot loader. This arrangement
works just as well if you use 98 or ME instead of 95 and use 2K or XP
instead of NT.
booted linux from dos using Loadlin, but I wanted an
easier way. I also did not want to go killing any of my
Here is a list of the steps I used
to set up booting Linux from the NT boot loader:
create a dummy boot sector
# dd if=/dev/zero
of=/c/linux.b bs=512 count=1
should do. If you want to understand the dd command read the man page
(man dd). You then set up lilo to use this file as the
boot sector. My lilo.conf looks like this:
boot=/mnt/c/linux.b # put the
location of your dummy boot sector
root=/dev/hdb2 # put your root fs location here (you may
not need it, but it won't hurt)
delay=10 # you can add all your regular lilo options
run lilo -v and make sure that
everything worked. Sometimes you might have to remove the linear
option and add lba32. Lilo will tell you if this is
I have /dev/hda1 mounted on /mnt/c, so the dummy boot sector is already accessible to the NT loader. If you only have NTFS or do
not wish to mount the filesystem,
you can copy the file
using mtools or an NTFS utility onto drive C. If you
don't want to risk that, you could reboot into NT and use
my explore2fs program to save the file onto drive C.
The final step is to modify the
boot.ini so you can select Linux. Add the line
C:\linux.b = "LILO
and reboot. Everything should work.
If not, don't blame me though. Make sure you know how to
recover should anything go wrong.
How to install RedHat Linux
- Install 95/98/ME. Don't use FAT32
- Install NT/2K/XP
- Install RedHat Linux. RedHat insists
that your /boot partition is below the 1024'th cylinder which is
not strictly necessary. I got around this by adding a spare
hard disk and creating /boot at the start of that disk.
- During the install process, install lilo to
/dev/hda7 NOT /dev/hda
- Make a boot disk. Until you perform the
steps above you will not be able to boot linux from the hard disk
- Boot linux off your floppy disk
- Back up the /boot partition
# cd /
# tar -cf /tmp/boot.tar /boo
- umount the /boot filesystem.
# umount /boot
- If step 8 does not work then you will have to
reboot to get rid of it. Edit /etc/fstab and remove the line
specifying /boot. Then reboot linux off your floppy disk
- Restore the /boot files
# cd /
# tar -xf /tmp/boot.tar
- Follow the steps above to create the boot
sector and configure and run LILO.