Linux Boot Process: What You Should Know

Ever wondered about the different stages of the open source operating system Linux? Understanding the entire boot process can help you resolve the issue, especially if you are an administrator.

What happens behind the scenes when the device is powered on? Please read it carefully to find out.

BIOS

A basic input / output system (BIOS) is a low-level firmware stored in a small memory chip on a computer’s motherboard. This firmware helps start the process and manages the data flow between the machine and other connected devices such as the mouse, printer and video adapter.

As shown above, the main function of the BIOS is to run the power-on self-test (POST). This test verifies the operability of the system hardware and finds the boot sector, which contains the software required for the rest of the process. If the POST is successful, the BIOS will load the next step (ie, the Stage One Boot Loader) into the system’s RAM.

If POST fails, the BIOS will return a code that can be used for troubleshooting.

First stage boot loader

The first stage of the boot loader, called the master boot record (MBR) or boot partition table (GPT), is designed to bring the program online.

MBR is a simple software with no inherent knowledge of the file system. As a result, you will always need to store the second-stage boot loader between the MBR and the first partition on your hard drive.

Once MBR detects the second stage boot loader, it will transfer control.

Second stage boot loader

The second phase of the bootloader’s job is to find the kernel and load it into memory.

Most Linux departments will use one of three different bootloaders-GRUB, GRUB2 or LIL. You will most likely see GRUB2, which is up to date, as shown in the image below.

Linux boot process Grub2

After the bootloader finds the kernel and loads it into RAM, it passes control. It also sends an image of the device file system, which the kernel can use to find modules.

core

Since all kernels exist in a compressed format to save hard disk space, once they gain control, the first thing it will do is self-extract. It will then mount the image version of the file system received from the boot loader.

The kernel will detect the system’s hardware and swap the image to a root file on disk.

Initialization (system)

Next, the kernel will start the init system-the first process will spawn all the processes needed for the boot process. On most systems, this will be systematic.

The main function of Systemd is to start all the daemons-background processes and services needed to run the system. These services will continue to run after initialization and manage the necessary system processes, such as logging various system messages, tracking devices, and ensuring that the file system is synchronized with system memory.

If you are curious about the services that systemd is running, run systemctl The command itself will return a complete list.

You can also use the systemctl command with the service to be started, and use systemd to start other services at startup. For example, if you want the system to check the status of NFS, you can type systemctl status nfs-server.service. you can also start, stop, enable Either disable A service that combines systemctl with one of these commands.

Runlevel

Runlevel is the state of INIT, and your system defines running services. The standard Linux kernel supports seven different run levels:

  • 0: System stopped, ready to power off
  • 1: Single-user mode
  • 2: Multi-user mode, no network file system
  • 3: Multi-user mode using command lifecycle interface instead of graphical user interface
  • 4: Custom
  • 5: Multi-user mode, using the graphical user interface to which most Linux systems boot by default
  • 6: Restart

Linux boot process initialization run level

If the runlevel needs to be changed for any reason, INIT will be responsible for using telinit Command, as shown above.

Breaking down the startup process

This failure is only an overview of the Linux boot process, leaving out some more detailed information. However, it should provide you with the information you need to resolve any issues you may encounter.

Ranch
                        
                    
                    Ranch

Sidebar