:content
I am not responsible for any loss of data, if you follow these steps!
These steps worked for my system, but I don't know, if you can do the same with your system.
There are two IDE hard disks in my PC, one (/dev/hda) with 20 GB entirely dedicated to Windows 2000 (i.e. one
primary partition only), the other one (/dev/hdb) with 80 GB, partitioned that way:
4 primary partions, the last primary partion (/dev/hdb4) holds three extended partitions:
- The first primary partion (/dev/hdb1) mounts the /boot folder of RedHat Linux 7.2 (25 MB),
- the second primary partion (/dev/hdb2) mounts the root system / (10 GB),
- the third primary partition (/dev/hdb3) is a NTFS-formatted partion (50 GB),
- the first extended partition (/dev/hdb5) is a FAT32-formatted partion (mounted as /mnt/exchange
to be able to exchange data between Linux and Windows) (7 GB),
- the second extended partition (/dev/hdb6) is a NTFS-formatted partion (for Windows 2000 data backup purposes) (12 GB), and
- the third extended partition (/dev/hdb7) is the swap-partition for Linux (1 GB).
Originally I had to boot Linux by using boot-floppy disks. I wanted to get rid of that, therefor I looked for a
nice dual-boot solution.
I decided to use the boot manager of Windows 2000 for a dual-boot of both Windows 2000 and Linux, because I did not
want to touch the master boot record (MBR) of the master disk.
One can read in the README-file of LILO, that it is not possible to boot a Linux OS entirely from the second hard disk
without even having the small /boot-folder placed on the master disk. In this case the authors suggest
to place LILO in the MBR of the master disk (/dev/hda).
Yet I wanted to try, if I could use the boot manager of Windows 2000 to boot both systems, thus avoiding to change the MBR
of the master disk. And I wanted to avoid using a partition manager for the creation of a small boot-partion on the
master disk, too. A lot of strange things I wanted ;-)
I edited /etc/lilo.conf to give it this content:
boot=/dev/hdb1
default=Linux
map=/boot/map
install=/boot/boot.b
lba32
image=/boot/vmlinuz-2.4.7-10
label=Linux
initrd=/boot/initrd-2.4.7-10.img
read-only
root=/dev/hdb2
Note, that there is no "Windows"-part (no line with e.g. other=/dev/hda1) in the config-file, since the PC will use
the Windows 2000 boot manager for booting Windows. LILO therefore does not need to take care for Windows 2000.
Running
# /sbin/lilo
or shortly
# lilo
gave the following output:
Warning: /dev/hdb1 is not on the first disk
Added Linux *
The warning confirms that the specified partition is not on the first disk (repeating the information from the README-file
that LILO 's boot sector can only be booted from the first disk unless some special boot manager is used). Don't panic,
the boot manager of Windows 2000 seems to be good enough for this job (the one from Windows NT 4.0 wasn't?)!
General information:
/sbin/lilo is not the LILO-bootloader itself, it just creates the bootloader
using the information it finds in /etc/lilo.conf.
Now I saved the Linux boot sector into a file (generating the same warning as above, of course):
# lilo -s /mnt/exchange/linux.bin
That way I wrote the file containing the boot sector directly to the disk/partition prepared for exchanging data with Windows 2000. Alternatively you can have lilo write the file to e.g. /tmp (by commanding # lilo -s /tmp/linux.bin), and then copy the file with mcopy to a DOS-formatted floppy disk. That's up to you.
I rebooted the system, this time booting into Windows 2000. I copied the file linux.bin into C:\, and
I edited C:\boot.ini, which is a hidden system file. Remove the system- and readonly-attributes with
C:\attrib -s -r c:\boot.ini
before you modify the file or use the folder-options to make system files both visible and writable. boot.ini now contained these lines:
[boot loader]
timeout=15
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
C:\linux.bin="Linux RedHat 7.2, Kernel 2.4.7-10"
Starting my PC I finally have the required two working options: either boot into Windows 2000 or into Linux (using LILO).
Technically a line C:\linux.bin="LILO" would better describe the behavior of the boot chain, since the Windows boot manager loads LILO if you choose the second line in the boot menu, which then loads the requested OS (in that case Linux from the second hard disk).
I edited the boot-part of /etc/lilo.conf by changing the first line:
boot=/dev/fd0 # change to floppy disk here
default=Linux
map=/boot/map
install=/boot/boot.b
lba32
image=/boot/vmlinuz-2.4.7-10
label=Linux
initrd=/boot/initrd-2.4.7-10.img
read-only
root=/dev/hdb2
That way I could create a LILO boot-enabled floppy disk by running /sbin/lilo again
(remember to put an ext2-formatted floppy disk in your computer, and to later undo the change in /etc/lilo.conf).
I verified that I could boot sucessfully into Linux by using this floppy disk as boot disk. Then
I copied the Linux boot sector from the floppy disk to a file by:
dd if=/dev/fd0 of=/mnt/exchange/bootsect.lnx bs=512 count=1
I rebooted the system, this time booting into Windows 2000. I copied the file bootsect.lnx into C:\, and
I edited C:\boot.ini this way (similar to variant 1, see above):
[boot loader]
timeout=15
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
C:\bootsect.lnx="Linux RedHat 7.2, Kernel 2.4.7-10"
Also this variant worked!
I hope this page is of help for you! Please remember to do backups of important data before you start working on boot
options. Always have boot disks prepared in advance, so you can anytime boot into the target OS's!
Note that it took some hours for me playing around with /etc/lilo.conf
and running /sbin/lilo afterwards, until I had the satisfying results (I am not a Linux expert).
If this was useful, then please drop a note in
my guestbook.
|