Skip to content

What is Linux Booting Process?

  • by
  • 4 min read

You must have noticed the time gap that is present from when you press the power button of your system until the time the login screen appears on the monitor. Have you ever wondered what happens in the system background during that time? Your system boots during that time, and the booting process is going on in the background.

Let’s dive in to see what happens during the Linux booting process.


What is the booting process?

The whole process during which your system starts, when you press the power button, load the programs, and process into the main memory until you see the login prompt, is known as the booting process.

Turing the power button on provides power to the motherboard so that the computer can boot. No matter what operating system you have and work on, every operating system has its booting process.

Also read: What is Kali Undercover and how to install it on Linux?


Stages of Linux booting process

The booting process of a Linux operating system has six stages.

BIOS 

BIOS stands for Basic Input / Output System. In this stage, BIOS performs some integrity checks and then looks for the boot loader in the hard drive, or CD-ROM, or SSD of your system.

The bootloader is a program that contains information about how to load the operating system into the memory. When it detects the bootloader, it loads the bootloader in the memory. BIOS gives control to the MBR Bootloader.


MBR  

Master Boot Record or MBR is present in the first sector of the bootable disk (/dev/had or /dev/sda). MBR consists of three details:

  • Primary boot loader information(446 Bytes) – It contains the information about the location details of the operating system and how to load said information.
  • Partition table information (64 Bytes) – It stores the partition details of a disk such as where a partition starts and where it ends.
  • MBR Validation Timestamp (2 Bytes) – The validation timestamp is used to retireve the MBR, if it gets corrupted or invalid.

These three together constitute a size of an MBR equal to or less than 512 bytes. As soon as your system knows these details, they’re loaded by MBR and the GRUB bootloader.


GRUB 

GRUB stands for Grand Unified Bootloader. and contains information about different filesystems. When you have different kernels installed in your system, you see a splash screen from where you can choose the kernel you want to work upon.

It waits for a few seconds for you to choose your kernel image. If you don’t choose any kernel, it loads the default kernel and initrd image (Initial RAM Disk) stored in the configuration file (/boot/grub/grub.conf).


KERNEL  

The kernel is the heart of the Linux operating system and handles all the system processes. In this stage, the kernel mounts the root file system, configures all the hardware, and loads all the necessary drivers.

Next, the kernel uncompresses the initrd image, mounts it, and executes the /sbin/init program. The init program is the first program that runs, and therefore, its process ID is always 1.

Also read: What is kernel in Linux?


INIT 

There are seven run levels in a Linux system. In this stage, the run level of the system is determined by looking into the initlevel from the /etc/inittab file.

Run LevelUse
0Shut down
1Single user mode
2Multiuser mode without Network
3Full multiuser mode
4Unused
5Multiuser mode under GUI
6Reboot

By default, run level 3 (Full multiuser mode) or run level 5 (Multiuser mode under GUI) is used.  You should never use the Run level o or 6 as your system shut down or will reboot every time it reaches the init stage.


RUNLEVELS 

When your system is booting up, many services are getting started. These services and programs are Runlevel programs. There are different directories (/etc/rc.d/rc*.d/  where * can be any number from 0 to 6) for each run level, and according to the value of the run level, your system gets from the init stage, the programs are loaded into your system.

The name of these programs usually starts with S(startup) or K(kill) and is used at the time of switch on or shut down, respectively. 


While booting the system, these six stages happen in the background in your system. After all of these processes are complete, you can see the login screen.

Also read: How to run Linux on Android devices?

Chetali Shah

Chetali Shah

An avid reader and an engineering student. Love to code and read books. Always curious to learn new things :)

>