M a r k   C r o s b i e

You are in: Linux and Windows on Omnibook 6000  Home  Resume  Linux  LEGO  Electronics  Movies  Mac OS X 


Details
Basic Install Kernel Network Power Management Dual Booting X Configuration Dock/Undock
Contact Mark at mark@mastincrosbie.com

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:
[boot loader]
timeout=10
default=c:\linux.bin
rem default=multi(0)disk(0)rdisk(0)partition(2)WINNT
[operating systems]
c:\linux.bin="Linux"
multi(0)disk(0)rdisk(0)partition(2)WINNT="Microsoft Windows 2000 Professional" /fastdetect


There are three points to notice in the file:
  1. Just like in LILO, the order of the choices governs the order in which they are displayed on the screen.
  2. The default= line controls the default selection.
  3. 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:
  1. Install Linux as usual.
  2. 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.
  3. When prompted, create a Linux boot floppy. This step is vitally important so that later you can boot into Linux.
  4. Reboot the system using the boot floppy.
  5. Create a linux.bin file: dd if=/dev/hda5 of=linux.bin bs=512 count=1
  6. Copy the linux.bin file to the root of your Windows installation.
  7. Edit the c:\boot.ini file in Windows and add an entry for Linux as shown in my example above.
  8. 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.




© 2002-2004 Mark Crosbie   shareright © 2002 Phlash