Installing GRUB on your system.
Installation of GRUB on your system is also simple and straight-forward. Once at the GRUB prompt, enter the following to install GRUB.
grub>root (hd0,0)
This is the location of the root for GRUB, NOT the root of your filesystem. This is the drive and partition that have your stage1, 1.5 and stage 2 files (located in /boot/grub). With GRUB treating all hard drives, IDE SCSI and others all the same, it can become confusing which drive actually contains the grub root. Luckily, there is a very simple way to find where these files are located. From the GRUB command prompt, type the following command:
grub>find /boot/grub/stage1
This will return a response similar to the following:
grub> find /boot/grub/stage1
(hd0,0)
grub>
If you have multiple drives that contain this file, it will list all locations that it was found at.
Once this is set, type the following:
grub>setup (hd0)
This is the location that you want the stage1 image to load to. (hd0) would load stage1 to the MBR of the first hard drive. This is the desired option for booting multiple OS's, using GRUB as the primary bootloader/menu. If for example you want to load GRUB to the first partition of the first drive, you would issue the command:
grub>setup (hd0,0)
This would be the preferred option if you either do not want to use the MBR for GRUB, or you are using another bootloader such as Boot Magic to boot the system, and want to chainload GRUB from that other
bootloader.
Typing this command will return something similar to the following:
grub> setup (hd0)
Run "embed /boot/grub/e2fs_stage1_5 (hd0)"
16 sectors are embedded.
Run "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2"
grub>
This will have successfully loaded grub, although it does have a problem. It will not have installed GRUB to use your menu.lst file. The solution to this is simple. Since GRUB has now provided you with all the necessary options for the stage1, 1.5 and 2 installation, simply duplicate the following portion of the last line:
install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2
and add (hd0,0)/boot/grub/menu.lst to the end so that the line would read:
install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 (hd0,0)/boot/grub/menu.lst
This will install GRUB so that it uses the /boot/grub/menu.lst file for your boot options. Note that the install lines shown above are all on one line, although they may wrap due to length as they did in the formatting of this document.
Once this is completed, type quit to exit the GRUB menu, and restart your system. You should now boot using GRUB, with the options specified in your menu.lst file presented to you on boot.
Source of these instructions: Zen and the Art of Using Grub.
|