Click to See Complete Forum and Search --> : Dual-booting Linux with XP on an NTFS partition


waqqas31
01-01-2003, 10:29 AM
I recently made the switch to an XP-only system (along with Linux, of course ;) ). To justify the switch, I changed the first partition on my hard drive to NTFS (from FAT32), but soon I realized that grub would no longer work to boot into my linux partition. Luckily I had my bootfloppy, which allowed me to get into linux, though it was painfully slow. Today I toyed around with a previously known method, and managed to boot into the linux partition, having barely touched my NTFS primary. Here's what you need to do:

1. download and install lilo (it should be available on the ftp's of most linux distributors)

2. Once it's installed, edit or create /etc/lilo.conf

The contents should be like the following:

# First up, be careful about spaces! They must be exact. First we specify the partition where ur linux is installed.
boot=/dev/hda3
#Then, include this next line, it need not be modified
map=/boot/map
#Do the same for this next line
install=/boot/boot.b
# Next you can specify lba32 or linear, the former worked for me
lba32

# Specify our boot image--check your /boot directory to see which one you have
image=/boot/vmlinuz-2.4.18-14
initrd=/boot/initrd-2.4.18-14.img
# Next, make sure u don't specify a non-linux partition for your root, or to be safe, use the same partition as u did for boot, if that's where you home directory is
root=/dev/hda3

# and that's the end of the file, go ahead and save it
----------------------------

Now we have to "process" lilo.conf and incorporate the changes.
Do the following:
$ /sbin/lilo

Now we have to create a copy of the boot sector. You can do this from any directory, just remember where you are!
Use your booting partitions info in the command:
$ dd if=/dev/hda3 of=bootsect.lnx bs=512 count=1

Here's the slightly tricky part. Since our primary partition (also our first partition on the hard disk) is NTFS, we can't write directly to it. You will have to email the file we just created (bootsect.lnx) to yourself, or put it on a floppy. E-mailing is recommended.

Now reboot your computer into windows.

Download/copy the bootsect.lnx file into your root C:\ directory.

Right-click My Computer and select Properties, then click on the Advanced tab. Click the button which will allow you to change startup settings. There will be a button to edit your boot.ini file, so go ahead and press that. After the last line of the file, add the following line:

C:\bootsect.lnx="Linux"

Save the file and exit. Now when you reboot, you will see the Linux option on your boot menu. Select it and press enter, and just keep ur fingers crossed :rolleyes:

Best of luck, I thoroughly enjoyed this endeavor, and I hope its rewarding for the rest of you as well.