Chapter #13: The Grand Unified Bootloader (GRUB)
In this chapter, you'll learn how the GRUB bootloader works, how to configure it, troubleshoot issues, and manage Linux boot options.

The Linux boot process, from the time you press the power button of your computer until you get a fully-functional system, follows this high-level sequence (as we discussed in Chapter 7, βManaging the startup process and related servicesβ, where we introduced the service management systems and tools used by modern Linux distributions):
- A process known as POST (Power-On Self Test) performs an overall check on the hardware components of your computer.
- When POST completes, it passes control over to the boot loader, which in turn loads the Linux kernel in memory (along with initramfs) and executes it. The most used boot loader in Linux is the GRand Unified Boot Loader, or GRUB for short.
- The kernel checks and accesses the hardware, and then runs the initial process (mostly known by its generic name βinitβ), which in turn completes the system boot by starting services.
In this chapter, we will introduce you to GRUB and explain why a boot loader is necessary, and how it adds versatility to the system.
Introducing GRUB
Two major GRUB versions (v1 - sometimes called GRUB Legacy - and v2) can be found in modern systems, although most distributions use v2 by default in their latest versions.
Only Red Hat Enterprise Linux 6 and its derivatives still use v1 today. Thus, we will focus primarily on the features of v2 in this guide.
Regardless of the GRUB version, a boot loader allows the user to:
- Modify the way the system behaves by specifying different kernels to use
- Choose between alternate operating systems to boot
- Add or edit configuration stanzas to change boot options
- Perform other advanced boot-time configurations
Today, GRUB is maintained by the GNU project and is well documented on their website. You are encouraged to use the official documentation while going through this guide.
The GRUB Boot Menu
When the system boots, you are presented with the following GRUB screen in the main console.
Initially, you are prompted to choose between alternate kernels (by default, the system will boot using the latest kernel) and are allowed to enter a GRUB command line (with c
) or edit the boot options (by pressing the e
key).
If GRUB is password-protected (a common configuration on multi-user systems), access to edit mode or the command prompt may be restricted until the correct password is entered. This security measure can help prevent unauthorized kernel parameter changes or entry to single-user mode.
One of the reasons why you would consider booting with an older kernel is a hardware device that used to work properly and has started βacting upβ after an upgrade (refer to this link in the AskUbuntu forums for an example).