Linux Booting Process – A Step-by-Step Guide (2021)
From the time you power on your Linux system to see the Linux login prompt, your system goes through a serious of phases. If you want to configure Linux and resolve startup issues, it is imperative for you to understand what it takes to get your system ready to run apps.
Today, we are going to shed light on what happens behind the boot-up process. So, let’s dive in and understand the Linux booting process in detail.
BIOS Integrity check (POST)
BIOS, aka Basic Input/Output System, is responsible for performing integrity check when the boot process is initialized. The process of integrity check of HDD or SSD, Keyboard, RAM, and USB is known as Power on Self-Test (POST).
Thereafter, it loads and executes the boot loader program found on the Master Boot Record (MBR). An error message splashes on the screen in case of any malfunction during the boot process. Otherwise, the booting procedure proceeds further to another level by BIOS giving control to the boot loader program.
GRUB2 into MBR
In Linux, there are mainly three types of bootloaders – GRUB, LILO, and GRUB2. Master Boot Record, situated in the 1st sector of the bootable disk, loads and executes the GRUB boot loader. Sometimes, this 512-byte code can be found on a DVD installation or Live USB of Linux.
Related: Congratulations to NASA’s Perseverance Rover, Linux Is Now On Mars
GRUB2 (GRand Unified Bootloader version 2), being the latest bootloader, executes and loads it onto the main memory (RAM). With the help of GRUB2, users can choose the desired Linux kernel version, edit some kernel parameters, and select the OS to boot in case of multiple OS installation.
In any operating system, Kernel is considered as the core because it has access to everything.
Kernel in Linux operating system controls all processes of the Linux system and provides access to services and hardware.
Therefore, it wouldn’t be wrong to say that gaining access to the kernel is equivalent to getting access to everything on a machine. Through a system call, a piece of software can write some data to memory by talking to the Kernel.
During this stage of booting, Kernel mounts the root file system mentioned in the grub.conf file, and it executes the /sbin/init program.
The startup process
Systemd is the mother of all processes because it brings the Linux system to an operational state so that users can perform productive work. Its functions include managing various aspects of a running Linux host, such as mounting filesystems, starting and managing system services for productive Linux host.
At the end of booting process, Kernel loads Systemd, which uses the /etc/systemd/system/default.target file so that Linux can boot into.
- The target value for a desktop workstation with a GUI is 5, equals to run level 5.
- In case of server, the run level is 3 because the default target is multi-user.target.
This is what going on under the hood when booting the Linux system. An operating system (OS) is the source of managing resources, controlling peripherals, and providing some necessary services to other software. Lately, Linux landing on the mars has boosted the demand for Linux profession. Certification based practical, interactive, and instructor-led Linux training in Chandigarh opens up a plethora of opportunities to get the dream job.