2. Installation

2.1. Download

Grub will be installed if Everything is chosen by Custom Installation at the time of installation.

grub can also be installed with the following command:

# mph-get install grub 

Note that LILO or any other boot loader will not be overwritten by just installing grub. So rest assured and install grub in your system.

2.2. Installing grub in a floppy disk.

Perhaps it is uneasy to install grub overwriting your HDD straight away.

It is worth making sure that grub boots up from a floppy disk before installing it in your HDD.

First, prepare a floppy disk which you can erase its contents.

Then, (as root if needed) do the following:

    # dd if=/usr/share/grub/i386-redhat/stage1 of=/dev/fd0 count=1      
    # dd if=/usr/share/grub/i386-redhat/stage2 of=/dev/fd0 seek=1 
   

2.3. Booting from a floppy disk

Here, assume your root partition of Linux is /dev/hda3 and you have Windows installed in /dev/hda1 partition.

Let's reboot with the floppy disk in your floppy drive.

You will see

grub>

and your system waits for your command.

To start Linux do as below:

    grub> root (hd0,2)      
    grub> kernel /boot/vmlinuz-2.4.19-12m root=/dev/hda3      
    grub> initrd /boot/initrd-2.4.19-12m.img      
    grub> boot 
   

To start Windows:

     grub> root (hd0,0)      
     grub> makeactive      
     grub> chainloader +1      
     grub> boot 
   

2.3.1. Key map

The default key map of grub is US keyboard. If you are using a Japanese 106 keyboard, "Shift+9" will get you a "(", so does "Shift+0" a ")", and "^" a "=".

2.3.2. Completion

The grub prompt has a bash-like completion feature.

Both a command and a filename can be completed. For example, in case of kernel command

Typing

grub> ker<TAB>

will get you

grub> kernel

2.3.3. About HDD numbering

grub describes HDDs as hd0, hd1, hd2, and so on.

grub makes no distinction between SCSI and IDE disks. The first HDD recognized by BIOS becomes hd0 and the 2nd be hd1.

Floppy Disk Drives are numbered in the same way: the 1st set to be fd0 and the 2nd to be fd1, and so on.