Heard about the GRUB boot loader but not sure what it does? Here is a simple explanation with everything you need to know.
A boot loader is one of the most important components of the boot process of your Linux operating system.
This article will show you what a boot loader is and what role it plays in a Linux system. This guide specifically focuses on the Grand Unified Bootloader (GRUB), a powerful and highly flexible bootloader program. Before looking at GRUB in detail, however, it is important to understand the Linux boot process.
The Linux boot process
The boot process in Linux is a series of activities that take place from the moment you press the power button on your PC until the login screen appears.
The boot process of your operating system consists of four main phases, which take place in the following order:
- BIOS: Stands for Basic Input / Output System and is mainly responsible for loading the bootloader. When the computer starts, it performs a Power On Self Test (POST) to make sure that the core hardware, such as memory and hard drive, is working properly. The BIOS then checks the master boot record (MBR) of the primary hard drives, which is a section on your hard drive where the boot loader is located.
- Bootloader: Loads the kernel into RAM with a set of kernel parameters.
- Kernel: The main function of the kernel is to initialize devices and memory. Then it loads the init process.
- Inside: Responsible for starting and stopping essential services on your system.
Note: The BIOS is not a Linux-related process, but a process that runs independently of your operating system.
What is the Grand Unified Bootloader?
GRUB is primarily responsible for providing you with a menu of options from which you can select the operating system or environment you want to boot into. In addition, GRUB is responsible for loading the Linux kernel.
This is what a GRUB menu option looks like. If you have multiple operating systems installed, they will be listed here.
Note: GRUB is not only limited to booting into Linux operating systems, you can use it to boot into other operating systems such as Windows.
There are two major versions of GRUB available at the time of this writing.
- GRUB legacy: This is the first version of GRUB and was originally developed in 1995.
- GRUB 2: This is the latest version of GRUB used by many mainstream Linux distributions such as Manjaro, Ubuntu, Fedora, and Red Hat Enterprise Linux (RHEL). GRUB 2 offers you better tools and configuration options than its predecessor.
In addition to GRUB, Linux distributions also use other boot loaders such as Linux Loader (LILO), coreboot and SYSLINUX.
The role of GRUB
Once you've selected the operating system to boot, GRUB loads the selected kernel. GRUB uses kernel parameters to know where the kernel is and other important parameters to use.
- initrd: Used to indicate the starting RAM disk.
- BOOT_IMAGE: The location of the Linux kernel image.
- root: Specifies the location of the root file system. Used by the kernel to find init, which in turn loads critical services.
- ro: Responsible for mounting the file system in read-only mode.
- calm: Hides some system-specific messages while your PC boots.
- Syringes: Used to display the splash screen when your system boots up.
Once in the GRUB options menu, you can edit the kernel parameters by pressing the pressing key E. Key on your keyboard.
Configure the GRUB boot loader
GRUB 2 offers you a lot of flexibility and performance when configuring your boot loader.
The / boot / grub Directory contains a file called grub.cfg, the main configuration file for GRUB. However, it is recommended that the grub.cfg Edit the file directly, instead you should use the edit / etc / default / grub File.
If you make changes to the / etc / default / grub File you should run the following command so that your changes are written to the file grub.cfg File automatically.
You can learn more about GRUB and some of its configuration options by running the following command:
info -f grub
Adapt GRUB under Linux
This guide showed you that GRUB is a very powerful and flexible boot loader and that it plays a crucial role in how your operating system works. Users have complete control over the appearance of the GRUB home screen. You can even customize the home screen wallpaper easily.
How to customize the grub boot menu with a background image
Bored of the standard grub menu? How to customize it with a background image of your choice.
About the author
(25 articles published)
Mwiza is a professional developer of software and writes extensively on Linux and front-end programming. His interests include history, economics, politics, and corporate architecture.
By Mwiza Kumwenda
Subscribe to our newsletter
Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive offers!
One more step …!
Please confirm your email address in the email we just sent you.