Linux Boot Process Illustrated: A Deep Dive into System Startup

Listen to this Post

Featured Image
The Linux boot process is a critical sequence that transforms a powered-off machine into a fully operational system. Below is a detailed breakdown of each step, along with practical commands and insights.

Step-by-Step Linux Boot Process

Step 1: Power-On and BIOS/UEFI Initialization

When the system powers on, the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) firmware loads from non-volatile memory and executes POST (Power-On Self Test).

You Should Know:

  • Check BIOS/UEFI version:
    sudo dmidecode -t bios
    
  • Enter BIOS/UEFI setup (usually by pressing F2, F12, DEL, or `ESC` during boot).

Step 2: Hardware Detection

BIOS/UEFI detects connected hardware (CPU, RAM, storage devices).

You Should Know:

  • List detected hardware:
    lshw
    
  • Check CPU info:
    cat /proc/cpuinfo
    

Step 3: Boot Device Selection

The firmware selects a boot device (HDD, SSD, USB, network).

You Should Know:

  • View boot order in Linux:
    efibootmgr
    
  • Modify boot order (UEFI systems):
    sudo efibootmgr --bootorder XXXX,YYYY
    

Step 4: Bootloader Execution (GRUB)

GRUB (Grand Unified Bootloader) loads the kernel.

You Should Know:

  • Edit GRUB config:
    sudo nano /etc/default/grub
    
  • Update GRUB after changes:
    sudo update-grub
    

Step 5: Kernel Initialization and systemd

The kernel initializes hardware, mounts the root filesystem, and launches `systemd` (PID 1).

You Should Know:

  • Check kernel version:
    uname -r
    
  • List systemd services:
    systemctl list-units --type=service
    

Step 6: Target Units and Startup Scripts

`systemd` activates `default.target` (usually `graphical.target` or `multi-user.target`).

You Should Know:

  • Change default target:
    sudo systemctl set-default multi-user.target
    
  • View boot logs:
    journalctl -b
    

Step 7: Login Prompt

The system presents a login window (GUI or CLI).

You Should Know:

  • Force a GUI login:
    sudo systemctl start gdm  GNOME 
    sudo systemctl start lightdm  LightDM 
    

What Undercode Say

Understanding the Linux boot process is essential for troubleshooting startup failures, optimizing boot times, and configuring custom kernel parameters. Key takeaways:
– Use `dmesg` to debug kernel messages.
– Modify `GRUB_CMDLINE_LINUX` in `/etc/default/grub` for kernel arguments.
– `systemd-analyze blame` helps identify slow-starting services.
– For rescue mode, boot into `init=/bin/bash` in GRUB.

Expected Output:

A fully booted Linux system with optimized startup, controlled services, and deep troubleshooting capabilities.

For further reading:

References:

Reported By: Alexxubyte Systemdesign – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram