01. January 2013 · Comments Off on Common GRUB 2 Option Tweaks for Debian, Ubuntu and Mint · Categories: Linux · Tags: Boot Loaders
Last updated on 11/13/2023

Since version 1.98, GRUB 2 began replacing GRUB version 0.9x, which is now known as GRUB legacy. GRUB 2 represents a major revision over its predecessor to make it more portable and modular. And although GRUB legacy is no longer being developed, bug fixes for it continue, and it’s still used as the default boot loader for a number of Linux distros. Over time, GRUB 2 usage has steadily increased and while still a work in progress, it’s probably the most common boot loader for Linux distros. Although GRUB 2 is officially known as GRUB, Linux distro repositories may include GRUB 2, GRUB legacy, or both versions. Repositories that include both versions may make the distinction between them as GRUB 2 and GRUB, GRUB and GRUB legacy, or GRUB 2 and GRUB legacy. The naming inconsistency between distros can be somewhat confusing, but this is to be expected during any transition.

What is covered in this guide

This is not a comprehensive guide on GRUB 2; rather, this is a quick reference covering frequently used GRUB 2 tweaks and option edits for most Linux distros; particularly those based on Debian/Ubuntu/Mint or Slackware. For detailed information about GRUB 2, see the references at the end of this guide.

This guide assumes that the reader already has GRUB2 installed for a single boot or a multiboot Linux system. Note that all changes to GRUB 2 options must be done while logged in as root or by use of sudo. All commands and options described should be verified for correctness using the documentation for your particular Linux distribution.

GRUB 2 summary

Recent converts to GRUB 2 probably have noticed that the Boot menu basically looks the same as GRUB legacy. Although they appear similar, the way GRUB 2 generates its menu is very different. Also, GRUB 2 now places its files in three locations:

  • /boot/grub/grub.cfg  (GRUB 2 main configuration file, replaces menu.lst, a product of the script files in /etc/grub.d/)
  • /etc/grub.d/  (directory containing several GRUB 2 script files)
  • /etc/default/grub  (GRUB 2 customization file)

Most GRUB 2 files are updated/regenerated automatically during package updates, when new kernels are added, after installing additional OS’s on multi-boot systems, or whenever GRUB is manually updated after making changes to the GRUB options as described in this guide. Generally, editing these files is not recommended, not only because it can cause boot problems, but also because most of the files will be overwritten anyway during system updates. The single file that users can generally edit without issue is /etc/default/grub, which holds most of the settings that will be of interest to users reading this. This file contains customization settings such as the default menu entry, timeout, default boot, graphics, and more. An example GRUB file from Lubuntu 12.10 (original settings slightly modified) is shown below:

# If you change this file, run '<strong>update-grub</strong>' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

<span style="color: #000000;">GRUB_DEFAULT=0</span>
<span style="color: #000000;">#GRUB_HIDDEN_TIMEOUT=0</span>
<span style="color: #000000;">GRUB_TIMEOUT=-1</span>
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
<span style="color: #000000;">GRUB_CMDLINE_LINUX_DEFAULT=""</span>

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

# Uncomment to disable graphical terminal (grub-pc only)

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
<span style="color: #000000;">GRUB_GFXMODE=auto</span>

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

# Uncomment to disable generation of recovery mode menu entries

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Quick Edits for /etc/default/grub

Note: A grub file can contain many more options than those shown in the above file. For a full list of options refer to the GNU Grub Manual (link in reference section below). Note that all GRUB 2 commands or changes to its files must be done while logged in as root or by using sudo.

As previously mentioned, the above sample GRUB 2 file is essentially the same as the default file for Lubuntu ver. 12.10. Note that the option entries listed in the above file may differ for other Linux distributions and/or versions. In most cases, users will want to make minor changes to the option entries that are common to all distributions and/or versions, such as timeout, default boot OS, displayed boot information (quiet splash), or the display resolution. To enable a listed option, remove the comment (#) in front of the option entry and change its value as appropriate. If a desired option is unlisted, it may be added to the end of the file. Also notice that the above file contains comments that provide information for enabling/disabling many of the listed options. After making any change to this file, it must be saved and GRUB updated in order for the changes to take effect on the next boot (see saving and updating section below). A few common option entries are described as follows:

Default option setting is 0.
This is the default menu entry to be booted. Zero (0) is the first boot option listed in /boot/grub/grub.cfg.

Default option setting is 5.
Sets the time in seconds that the boot menu displays before it automatically boots the default boot entry. If a key is pressed before that time, the timeout is cancelled, allowing manual selection of the entry with no time limit. The value “-1” causes the menu to be displayed indefinitely.

Default setting is distro dependent.
Passes arguments to the end of the boot command line for the kernel of the menu’s default entry. Added in addition to any arguments specified in GRUB_CMDLINE_LINUX below. This option is often set to “quiet splash” to suppress boot information and display the splash screen. Note that “quiet” and “splash” are separate values. Remove “quiet splash” between the parentheses to display all boot information without a splash screen.

Default setting as above.
Passes arguments to the end of the boot command line for the kernels of all the menu entries.

Default setting is “auto”.
Sets the graphical terminal resolution. Only modes supported by the graphics card VESA BIOS Extensions (VBE) can be used. To determine the available screen resolutions, type “c” for a command line at the GRUB 2 boot menu and then enter “vbeinfo.” The syntax for the option value is widthxheight[xdepth]. Some common option values are 1400x900x32, 1024×768, and 800×600.

Recovery mode entries are generated by default.
Enable by removing #, which will disable generation of the recovery mode entries; otherwise, for each Linux kernel, at least two menu entries will be generated – the default entry and a recovery mode entry.

Saving and updating the edited /etc/default/grub file

After editing and saving the /etc/default/grub file the following command must be executed for the changes to take effect:

sudo update-grub

To restore the default settings for GRUB 2, reinstall GRUB 2 by executing the following command:

sudo grub-install /<target>

Where <target> /dev/sda, /dev/hda

GRUB 2 tools

Graphical tools for configuring Grub 2 have become more common as Grub 2 matures. One GUI tool available on many repositories is grub-customizer. See this How-to-Geek article for a description of this tool.

Changing the GRUB 2 background image


Good tutorials describing how to change the GRUB 2 background image:

The Geek Stuff – How to Change GRUB Splash Image, Background, Font Color on Your Linux




openSUSE® – Chapter 10. The Boot Loader GRUB2

GRUB 2 bootloader – Full tutorial by Dedoimedo

Official Ubuntu Community Documentation – Grub 2

Grub 2 Basics by DRS305 – Ubuntu Forums


If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Print Friendly, PDF & Email

Bad Behavior has blocked 2188 access attempts in the last 7 days.

Spelling error report

The following text will be sent to our editors: