Linux and Windows
Can Linux and Windows 2000 coexist in peace? The answer is Yes!
It took a number of attempts to make it work, but the key is allow
the Windows OS loader to boot first, and then choose to boot Linux
from the OS loader. The LILO loader is then loaded and you can choose
which Linux OS image you want to boot. It's a two step boot process,
but with short timeouts on each loader it does not add much delay
to your boot time.
The Windows OS Loader is controlled by the C:\boot.ini file.
It contains the name of each OS image, and where to locate the boot
block. My boot.ini file looks as follows:
multi(0)disk(0)rdisk(0)partition(2)WINNT="Microsoft Windows 2000 Professional" /fastdetect
There are three points to notice in the file:
- Just like in LILO, the order of the choices governs the order in which
they are displayed on the screen.
- The default= line controls the default selection.
- The boot block for Linux is specified as the file c:inux.bin
How is the linux.bin file generated? When you initially install
your system in its Linux partition, you will place LILO at the start
of the partition, not at the start of the drive. The first 512
byte block of this partition contains the Linux boot loader. You simply
need to provide this boot loader image to Windows as follows:
- Install Linux as usual.
- When prompted, install the LILO loader at the start of the Linux
partition (your root partition), not at the start of the drive.
For example, my root Linux partition is /dev/hda5, so that is
where the LILO loader goes.
- When prompted, create a Linux boot floppy. This step is vitally
important so that later you can boot into Linux.
- Reboot the system using the boot floppy.
- Create a linux.bin file: dd if=/dev/hda5 of=linux.bin bs=512 count=1
- Copy the linux.bin file to the root of your Windows installation.
- Edit the c:\boot.ini file in Windows and add an entry for Linux
as shown in my example above.
- Reboot the computer and then choose Linux from the Windows OS Loader. The
LILO loader should then appear, and you can boot into Linux.
NOTE: If you recompile your kernel you typically run /sbin/lilo
to place the new boot loader image onto the boot block of your disk. You
must remember to copy the boot block image to the c:inux.bin
file otherwise the Windows OS Loader will fail to load LILO correctly.