Intro
A boot loader is one of the most important components of Linux operating systems boot process.
When a device starts up, working memory must be loaded with operating system data. The so-called bootloader, usually referred to as a boot program or bootstrap loader, enables this.
Grand Unified Bootloader(GRUB)
The boot process on Linux is a series of activities that occur from the time you press the power on button on your PC until the login screen appears
Stages of boot process
There are four main stages in the boot process
- BIOS
- mainly responsible for loading the bootloader
- When the computer starts, it runs a Power On Self Test(POST) to make sure that the core hardware such as memory and hard disk is working properly
- Afterwards, the BIOS will check the primary hard drives Master Boot Record(MBR), which is a section on your hard drive where the bootloader is located
- Bootloader
- Loads the kernel into RAM with a set of kernel parameters
- Kernel
- The kernel primary function is to initialize devices and memory
- Afterwards it loads the init process
- Init
- Responsible for starting and stopping essential services on your system GRUB is mainly responsible for providing you with an options menu from which you can select the operating system or environment that you want to boot into
GRUB is not only limited to booting into Linux operating system, you can also use it to boot into other operating systems such as windows
The Role of GRUB
Once you select the operating system to boot into, GRUB will load the selected kernel
GRUB uses kernel parameters to know where the kernel is located and other important parameters to use
- initrd
1. used for specifying the initial RAM disk
- BOOT_IMAGE
- the location of the linux kernel image
- root
- specifies the location of root file system, used by the kernel to find init which in turn loads the critical services
- ro
- responsible for mounting the file system in read-only mode
- quiet
- hides some system specific messages as your PC is booting
- splash
- used for displaying the splash screen when your system is booting
- When you are in the GRUB options menu, you can edit kernel parameters by pressing the “E” key
- BOOT_IMAGE
GRUB 2 gives you a lot of flexibility and power when it comes to configuring your bootloader
The /boot/grub directory contains a file named “grub.cfg” which is the main configuration file for GRUB
However, it is advised not to edit the grub.cfg file directly, instead you should edit the “/etc/default/grub” file
-
When you make changes to the “/etc/default/grub” file, you should make sure to run the command below, so that your changes are written to the grub.cfg file automatically
- sudo update-grub
Top comments (0)