Freedom, Community & Sustainability

Simple configurations of boot with GRUB2

March 16, 2012 -- William
Last modified on November 2017
Duration: 5 minutes or less

What is GRUB?

GRUB is the name given to the GRand Unified Bootloader. It is a program that runs every time you start up your machine and decides what operating system is going to run on the computer. Even if you only have one operating system on your machine, you might be greeted with the GRUB screen and be able to choose between kernel versions, boot in recovery mode or run memory tests. GRUB2 is an enhanced version of GRUB, often used on popular GNU/Linux distros.

Changing GRUB2 settings

Warning: wrong configurations of GRUB or any boot file may make your computer unable to boot up and become unusable. For this reason the folders and files are read-only by default. Don't touch on these configurations if you don't want to take risks or don't feel like troubleshooting your computer in case of problems. You shouldn't have any problems though if you follow the steps below.

To change how GRUB2 acts upon startup you will have to edit the file /etc/default/grub. You need to have root privileges to edit this file so you can't just open it from Nautilus and edit it. Open a terminal and type:

sudo gedit /etc/default/grub

The file will open just as if you clicked it on Nautilus but you will be able to edit it.

The most common lines that you might want to edit:

GRUB_DEFAULT=X→ (replace X with one of the following options) if you enter a number here it will determine the default option in the list if the user do not change manually on start up. The first line of the GRUB2 menu is 0, the second is 1 and so on. Alternatively you can enter the exact option you want by typing something like "Ubuntu, Linux 3.2.0-generic"

GRUB_HIDDEN_TIMEOUT=X→ X will be the number of seconds that the menu will wait before booting the default option set before. When you set up this option the menu will be hidden and you can press any key to show the menu. If you want the menu to be displayed on startup add # at the beginning of the line to disable the hidden menu. If X is set to 0 you can still display the menu by pressing the SHIFT key on startup.

GRUB_HIDDEN_TIMEOUT_QUIET=true/false→ This option displays (or not) the timeout counter.

GRUB_TIMEOUT=X→ This setting is only used if  GRUB_HIDDEN_TIMEOUT is not active (has been deactivated by # at the beginning of the line). If you set it to -1 the menu will be displayed until the user makes a selection, values of 0 or more correspond to the number of seconds the menu will be displayed.

Once you changed the configurations to fit your needs run sudo update-grub in Terminal to apply the changes.

For more details on the other parameters, refer to this extensive tutorial on Dedoimedo or to the Ubuntu help documentation

Making boot more beautiful

If you decided that you want GRUB2 to show up because it's useful but you find it a bit ugly, don't worry, there's a way to make it just as you want it to be.

The first option to enhance the boot aesthetics is to add images to GRUB2 background. To do this, add an image to the folder /boot/grub and don't forget to run sudo update-grub when you are done.

About BURG

There is another option to make your boot loader even more awesome using BURG, the Brand-new Universal loadeR from Grub. BURG replaces the command-line-style of GRUB with a sexy graphical interface. Instead of a descriptive list of options you can choose to have icons for your different OS's. If you have a dual-boot machine I'd recommend to take a look at BURG since you are going to be greeted with the menu at every login. Check out the Ubuntu help page linked below to learn how to install and configure it.


Add new comment