Pick a Free OS

User login

Navigation

GRUB: Multi-boot without LILO!

The other entry you will see here for booting Windows. This entry is a little different. The root entry here points to the root partition (c:\) of your DOS/Windows installation. The next entry sets the active flag on the partition. The final entry tells GRUB to grab the first sector of the partition -- booting the OS there.

This was the configuration of the most common dual-boot setup for GRUB. Now you have to install GRUB as your boot loader. Keep a LILO floppy or a rescue disk in hand before you do so.

grub-install /dev/hda

Login as root and run the command "grub". You will then be looking at the following

GRUB version 0.5.96.1 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB

lists possible command completions. Anywhere else TAB lists the possible

completions of a device/filename. ]

grub>

This is the grub prompt that we will use to install GRUB on the hard drive. There's one long and complicated command-line that we're going to use.

grub> install (hd0,1)/boot/grub/stage1 d (hd0) (hd0,1)/boot/grub/stage2 p (hd0,1)/boot/grub/menu.lst

GRUB is divided into 2 major stages: stage1 and stage2. Stage1 is the tiny code that is embedded into the MBR. Stage2 is the main component here and handles everything else after Stage1 transfers control to it at boot-up.

The relevant parts of the command-line here are the first parameter given after ‘install’. This should point to the location of stage1 on your hard drive. As you can see, we're using the full drive notation as well as pointing to a specific directory on the partition. This is possible because GRUB can read filesystems. The 'd' parameter means that Stage1 will look for the disk where Stage2 is installed. (hd0) is the location where GRUB will be installed to. Since we want to use it as our primary boot loader, this means that it will install to the MBR. You can also point it to the root partition of your filesystem. The next parameter is the location of Stage2. This is also specified in the same manner as for Stage1. Then comes 'p' followed by the location of the configuration file menu.lst.