Jump to content
How to create the GRUB boot menu
Submitted by carlaschroder
Posted Aug 24 2009 02:18 PM
As fun as it is to discover root devices and kernels from the GRUB command line, you would like to preserve your boot parameters in a configuration file and have a nice boot menu to use at startup. In this menu you will configure your chosen defaults, and have a menu of all of your installed operating systems to choose from.
Add boot entries to GRUB's configuration file, /boot/grub/menu.lst. (Red Hat uses grub.conf and creates a soft link named menu.lst.)
GRUB calls the different boot entries stanzas. Here is a basic configuration:
title Fedora 1 core
kernel /boot/vmlinuz-2.4.22-1 root=/dev/hda1 ro
The title can be anything at all, and you must have one—it tells GRUB where each stanza starts, and it appears in the boot menu. The other two lines are the same values we used on the GRUB command line. It is not necessary to use the boot command in menu.lst.
You can list as many operating systems as you want; each one requires a stanza like this one. Make sure the kernel line points to the right partition and kernel executable. It's common to have several bootable kernels in the same root partition. And it is common (even good) for all the boot configurations to use the same boot partition.
Not all Linux distributions require a ramdisk, which is loaded by the initrd image. If /boot/initrd-* exists, you must use it.
Remember that the root device, indicated by:
is the location of the /boot directory, and hd0,0 is GRUB's own numbering system. On the kernel line:
kernel /boot/vmlinuz-2.4.22-1 root=/dev/hda2 ro
root is the root filesystem, using the kernel dev name.