Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Booting a system from the GRUB prompt:
Booting the system from a GRUB prompt is simple and straight-forward. You will specify options in the same order that they are listed in the menu.lst examples, with an extra step to get it all going. For example, to boot a Linux system from the GRUB prompt, you would enter commands as in the following example. The example would be for a system with Linux installed on the first partition of the first drive, with the /boot/grub directory located off / and not in its own partition.
grub>kernel = /boot/vmlinuz-pc97-2.2.14-modular root=/dev/hda1
The first line, root (hd0,0) tells GRUB where the root is located._ Note once again that this is the root for GRUB, and not the filesystem root /. This is the location of the Stage 1, 1.5 and 2 image files.
The second line, kernel = /boot/vmlinuz-pc97-2.2.14-modular_ root=/dev/hda1, is the location of your kernel, and any options that need to be passed to the kernel. For example, if the root of the OS (/) was located on a different partition that /boot/grub, you would specify it on this line. Other options such as noapic, nosmp, debug=2 and vga=normal would also be specified on this line.
The third line, boot, is the magic command that gets the whole thing_ going. It uses the information specified before it to boot the OS. In this example, it would try to load the kernel from /boot and use
/dev/hda1 as the root filesystem.
Other OS's would be similar, using the options required for the particular OS entered on the GRUB command line before the boot command is given.
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.
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:
This will return a response similar to the following:
grub> find /boot/grub/stage1
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:
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:
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
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"
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.
The forgoing is an excerpt from "Zen and the Art of Using Grub". Note that it will work on SuSE because SuSE uses /boot/grub/menu.lst as the config file. I believe that FC uses /boot/grub/grub.conf instead. So adjust accordingly.