The simplest way to install GRUB is to use the
For example, to install GRUB on the master boot record of the first hard drive in a system, invoke grub-install as follows:
grub-install looks for a device map file (/boot/grub/device.map by default) to determine the mapping from BIOS drives to Linux devices. If this file does not exist, it will attempt to guess what devices exist on the system and how they should be mapped to BIOS drives. If grub-install guesses incorrectly, just edit /boot/grub/device.map and rerun grub-install.
The device map file contains any number of lines in this format:
So, for example, on a system with a floppy and a single SCSI disk, the file would look like this:
(fd0) /dev/fd0 (hd0) /dev/sda
GRUB can also be installed using the grub command. The grub-install example shown earlier could also have been done as follows, assuming /boot is on the first partition of the first hard disk: