The Menu Configuration File

The configuration file, which is used to create the list in GRUB's menu interface of operating systems to boot, essentially allows the user to select a pre-set group of commands to execute. The commands given in the Section called Commands can used, as well as some special commands that may only be used in the configuration file.

Special Configuration File Commands

The following commands can only be used in the GRUB menu configuration file:

The # character can be used to place comments in the menu configuration file.

Configuration File Structure

The commands to set the global preferences for the GRUB menu interface are placed at the top of the file, followed by the different entries for each of the operating systems to boot.

A very basic GRUB menu configuration file designed to boot either Red Hat Linux or Microsoft Windows 2000 might look as follows:

default=linux
timeout=10
color=green/black light-gray/blue

# section to load linux
title linux
root (hd0,1)
kernel /vmlinuz root=/dev/hda5
boot

# section to load Windows 2000
title windows
rootnoverify (hd0,0)
chainloader +1

This file would tell GRUB to build a menu with Red Hat Linux as the default operating system, set to autoboot it after 10 seconds. Two sections are given, one for each operating system entry, with commands specific to this system's disk partition table.

Actually configuring a GRUB menu configuration file to boot multiple operating systems is beyond the scope of this chapter. Please consult the Section called Additional Resources for detailed information about booting various operating systems with GRUB.