NTBOOT

WINDOWS NT BOOT

From: "Les Bell" lesbell@lesbell.com.au

>> Is there a way to put OpenLinux into the NT4 Boot.ini?<<


Yes, easy peasy. Let's assume, for the sake of the exercise, that you have installed Linux on /dev/hda2, and that LILO is installed into the boot sector of that partition.

Case 1: NT is installed in C:, which is a FAT drive, and therefore can be mounted rw under Linux.

Step 1: Mount your NT C: drive under Linux, as /mnt/ntc:

mkdir /mnt/ntc
mount -t msdos /dev/hda1 /mnt/ntc

Step 2: Peel off the LILO boot sector and save it in the file boot.lnx on the NT C: drive.

dd if=/dev/hda2 of=/mnt/ntc/boot.lnx bs=512 count=1

Step 3: Reboot to NT, and edit the NT boot.ini file

attrib -r -h boot.ini
notepad boot.ini

Add the line

c:\boot.lnx="Caldera Open Linux"

at the bottom of the file, then save the file.

If you now reboot, you should be able to select "Caldera Open Linux", and boot into Linux.

NB: if you rerun LILO at any point, you will need to repeat the above procedure of peeling off the LILO boot sector.

Which leads us to:

Refinement 1: Edit fstab to mount the NT C: drive whenever you reboot, and modify lilo.conf to always write the LILO boot sector to the right place.


Step 1: Become root user, cd to /etc, and edit /etc/fstab:

su
[Enter your root password]
cd /etc
vi fstab

Use the arrow keys to move down to the last line of the file, then press "A" to append at the end of the line, press "Enter" and add the following line:

/dev/hda1 /mnt/ntc msdos defaults,user 0 0

Then press "ESCape", followed by ":wq" to write the file and quit.

Step 2: Edit /etc/lilo.conf:

vi lilo.conf

Use the arrow keys to move down to the line where it says

boot=/dev/hda2

and move across until the cursor is on top of the first "/", then press "9xA" and then type "/mnt/ntc/boot/lnx". The line should now read

boot=/mnt/ntc/boot.lnx

Press "ESCape", followed by ":wq" to write the file and quit.

Now, when you reboot, your NT C: drive will automatically be mounted as "/mnt/ntc" and whenever you rerun the lilo command, it will put the new LILO boot sector into the right place.

Case 2: NT is installed in C:, which is an NTFS drive, and therefore cannot be mounted rw under Linux.


Step 1: Insert a DOS-formatted floppy disk and mount it under Linux.

Insert a DOS-formatted floppy in the floppy drive and give the following command:

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

Step 2: Peel off the LILO boot sector and save it in the file boot.lnx on the floppy disk.

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

Step 3: Reboot NT and copy the boot sector into place.

Remove the floppy disk, and give the command (su if necessary)

shutdown -r now

After rebooting to NT, insert the floppy disk and give the command:

copy a:boot.lnx c: /v

Step 4: Edit the NT boot.ini file.

attrib -r -h boot.ini
notepad boot.ini

Add the line

c:\boot.lnx="Caldera Open Linux"

at the bottom of the file, then save the file.

If you now reboot, you should be able to select "Caldera Open Linux", and boot into Linux.

NB: if you rerun LILO at any point, you will need to repeat the entire above procedure of peeling off the LILO boot sector and copying it to floppy before rebooting to NT and copying it into place.

Caution: although I've done this many times, I didn't repeat it yet again while writing this; I just wrote it from memory. Please let me know of any problems. I particularly like Refinement 1, which eliminates the need for the tedious dd command.

Boring legal requirement: Copyright (c) 2000 Les Bell and Associates Pty Ltd. Reproduction for non-commercial purposes permitted, with attribution

searchSearch Index