Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

E.8.2. Configuration File Directives

The following are directives commonly used in the GRUB menu configuration file:
  • chainloader </path/to/file> — Loads the specified file as a chain loader. Replace </path/to/file> with the absolute path to the chain loader. If the file is located on the first sector of the specified partition, use the blocklist notation, +1.
  • color <normal-color> <selected-color> — Allows specific colors to be used in the menu, where two colors are configured as the foreground and background. Use simple color names such as red/black. For example:
    color red/black green/blue
  • default=<integer> — Replace <integer> with the default entry title number to be loaded if the menu interface times out.
  • fallback=<integer> — Replace <integer> with the entry title number to try if the first attempt fails.
  • hiddenmenu — Prevents the GRUB menu interface from being displayed, loading the default entry when the timeout period expires. The user can see the standard GRUB menu by pressing the Esc key.
  • initrd </path/to/initrd> — Enables users to specify an initial RAM disk to use when booting. Replace </path/to/initrd> with the absolute path to the initial RAM disk.
  • kernel </path/to/kernel> <option-1> <option-N> — Specifies the kernel file to load when booting the operating system. Replace </path/to/kernel> with an absolute path from the partition specified by the root directive. Multiple options can be passed to the kernel when it is loaded.
    These options include:
    • rhgb (Red Hat graphical boot) — displays an animation during the boot process, rather than lines of text.
    • quiet — suppresses all but the most important messages in the part of the boot sequence before the Red Hat graphical boot animation begins.
  • password=<password> — Prevents a user who does not know the password from editing the entries for this menu option.
    Optionally, it is possible to specify an alternate menu configuration file after the password=<password> directive. In this case, GRUB restarts the second stage boot loader and uses the specified alternate configuration file to build the menu. If an alternate menu configuration file is left out of the command, a user who knows the password is allowed to edit the current configuration file.


    It is highly recommended to set up a boot loader password on every machine. An unprotected boot loader can allow a potential attacker to modify the system's boot options and gain access to the system. See the chapter titled Workstation Security in the Red Hat Enterprise Linux Security Guide for more information on boot loader passwords and password security in general.
  • map — Swaps the numbers assigned to two hard drives. For example:
    map (hd0) (hd3)
    map (hd3) (hd0)
    assigns the number 0 to the fourth hard drive, and the number 3 to the first hard drive. This option is especially useful if you configure your system with an option to boot a Windows operating system, because the Windows boot loader must find the Windows installation on the first hard drive.
    For example, if your Windows installation is on the fourth hard drive, the following entry in grub.conf will allow the Windows boot loader to load Windows correctly:
    title Windows
    map (hd0) (hd3)
    map (hd3) (hd0)
    rootnoverify (hd3,0)
    chainloader +1
  • root (<device-type><device-number>,<partition>) — Configures the root partition for GRUB, such as (hd0,0), and mounts the partition. To specify the boot drive selected by the EFI boot manager, the syntax is <device-type>,<partition>, such as (bd,1).
  • rootnoverify (<device-type><device-number>,<partition>) — Configures the root partition for GRUB, just like the root command, but does not mount the partition.
  • timeout=<integer> — Specifies the interval, in seconds, that GRUB waits before loading the entry designated in the default command.
  • splashimage=<path-to-image> — Specifies the location of the splash screen image to be used when GRUB boots.
  • title group-title — Specifies a title to be used with a particular group of commands used to load a kernel or operating system.
  • device grub-device-name uefi-device-name — Assigns a GRUB device name to refer to a specific UEFI device. The argument grub-device-name should be replaced with a GRUB device name, for example (hd0). The argument uefi-device-name should be replaced with a UEFI device name in the form of either HD(number, start, size, signature), or CD(index, start, size), where number is the partition number, starting at 1, index is the index of the CD's El Torito boot entry, start and size are the start position and size of the partition respectively, in sectors, in hexadecimal format, and signature is the partition's unique GUID.
To add human-readable comments to the menu configuration file, begin the line with the hash mark character (#).