Linux Boot Process : Learn about the Linux boot process step by step. Understand BIOS/UEFI, bootloaders like GRUB, kernel initialization, init systems, and runlevels.
Introduction of Linux Boot Process
The Linux boot process is the sequence of events that occur from the moment a computer is powered on until the operating system is fully loaded and ready for use. Understanding this process is essential for system administrators, embedded engineers, and Linux users troubleshooting boot issues.
In this guide, we will explore the Linux boot sequence, covering each stage in detail, from BIOS/UEFI initialization to reaching the login prompt.
1. BIOS/UEFI – Hardware Initialization
The boot process begins with the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface). This firmware checks the system hardware and locates a bootable disk.
Key Functions of BIOS/UEFI:
✅ Performs Power-On Self-Test (POST) to detect hardware issues.
✅ Initializes the CPU, RAM, and storage devices.
✅ Searches for a bootable disk (HDD, SSD, USB, Network).
✅ Loads the bootloader from the Master Boot Record (MBR) or EFI partition.
📌 Related: How to Check BIOS Version in Linux
2. Bootloader – Loading the Linux Kernel
The bootloader is responsible for loading the Linux kernel and passing necessary parameters.
Common Bootloaders in Linux:
- GRUB (GRand Unified Bootloader) – Most widely used.
- LILO (Linux Loader) – Legacy bootloader, less common.
- systemd-boot – Used in systemd-based distributions.
- U-Boot – Popular for embedded Linux (ARM-based systems).
Bootloader Responsibilities:
✅ Loads the Linux kernel into RAM.
✅ Passes kernel parameters (e.g., root filesystem location).
✅ Loads the initial RAM disk (initramfs/initrd).
🔹 GRUB Boot Configuration Example:
GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"
GRUB_CMDLINE_LINUX=\"root=/dev/sda1 ro\"
📌 Related: How to Fix GRUB Boot Issues
3. Kernel Initialization
Once the bootloader executes, the Linux kernel takes control.
Kernel Responsibilities:
✅ Initializes memory management, CPU scheduling, and process handling.
✅ Detects and initializes hardware components.
✅ Mounts the root filesystem (/
).
✅ Starts the init system (PID 1).
📌 Related: Linux Kernel vs Unix Kernel
4. Initramfs/Initrd – Temporary Root Filesystem
Before mounting the main root filesystem, Linux uses a temporary filesystem (initramfs/initrd) to:
✅ Load necessary kernel modules (e.g., RAID, LVM).
✅ Mount the actual root filesystem.
🔹 How to View Initramfs Contents:
lsinitrd /boot/initramfs-$(uname -r).img
📌 Related: How to Rebuild Initramfs in Linux
5. Init System – Starting User Space Processes
The init system is the first user-space process executed by the Linux kernel (PID 1). It manages system services and startup scripts.
Popular Init Systems in Linux:
- Systemd (Modern Linux distributions)
- SysVinit (Older Linux distributions)
- Upstart (Legacy Ubuntu versions)
🔹 Systemd Process Tree Example:
systemctl list-units --type=service
📌 Related: Systemd vs SysVinit
6. Runlevels & System Targets
Runlevels (SysVinit) or system targets (systemd) define the state of a Linux system at boot.
Runlevels (SysVinit):
- 0 – Shutdown
- 1 – Single-user mode
- 3 – Multi-user, no GUI
- 5 – Multi-user with GUI
- 6 – Reboot
Systemd Targets:
- poweroff.target – Shutdown
- rescue.target – Single-user mode
- multi-user.target – CLI mode
- graphical.target – GUI mode
- reboot.target – Reboot
🔹 How to Change Runlevel in Systemd:
systemctl isolate multi-user.target
📌 Related: Linux Runlevels Explained
7. User Login & Shell Execution
Once all system services are initialized, the Linux system presents:
✅ A text-based shell (Bash, Zsh).
✅ A graphical login manager (GDM, SDDM, LightDM).
🔹 How to Check Running Shell:
echo $SHELL
📌 Related: Bash vs Zsh – Which Shell is Better?
8. Linux Boot Process in Embedded Systems (ARM)
For ARM-based Linux systems, the boot sequence differs slightly:
1️⃣ ROM Code Execution – Loads the primary bootloader (MLO/SPL).
2️⃣ Primary Bootloader (U-Boot SPL) – Initializes RAM.
3️⃣ Secondary Bootloader (U-Boot) – Loads the Linux kernel.
4️⃣ Kernel Decompression & Execution
5️⃣ Device Tree Parsing
6️⃣ Init System Execution
📌 Related: How U-Boot Works in Linux
Frequently Asked Questions (FAQs)
What is the Linux boot process in simple terms?
It’s the sequence of events from powering on a system to reaching the user login prompt, involving BIOS, bootloader, kernel, init system, and services.
Why does Linux use Initramfs?
Initramfs provides a minimal root filesystem for loading essential kernel modules before mounting the main filesystem.
How to reduce Linux boot time?
✅ Disable unnecessary kernel modules.
✅ Optimize systemd services using systemctl disable <service>
.
✅ Use lightweight bootloaders like systemd-boot.
📌 Related: How to Speed Up Linux Boot Time
Conclusion
The Linux boot process is a crucial aspect of system administration and embedded Linux development. Understanding how Linux boots—from BIOS/UEFI to user space—helps in troubleshooting, optimizing, and customizing the system.
Did you find this guide helpful? Share your thoughts in the comments below!
Thank you for exploring Linux Boot Process! Stay ahead in embedded systems with expert insights, hands-on projects, and in-depth guides. Follow Embedded Prep for the latest trends, best practices, and step-by-step tutorials to enhance your expertise. Keep learning, keep innovating!
You can also Visit other tutorials of Embedded Prep
- Top 30+ I2C Interview Questions
- Bit Manipulation Interview Questions
- Structure and Union in c
- Little Endian vs. Big Endian: A Complete Guide
Leave a Reply