The Linux Boot Process
Module 5 · Boot Process & System Initialization

The Linux Boot Process

Everything that happens between pressing the power button and reaching a login prompt — firmware, bootloader, kernel, and initramfs.

What “Booting” Means

Booting is the process — repeated every time a computer starts — of loading an operating system from a storage device into memory so a user can access it. At a high level, four components hand off control to each other in sequence:

Firmware → Bootloader → Kernel → Init system


Firmware: BIOS vs. UEFI

BIOSUEFI
AgeLegacy, standard since the 1980sModern replacement for BIOS
Stored onThe motherboard’s ROM chipThe motherboard’s ROM chip
Partition table it expectsMBRGPT (though most UEFI implementations can boot MBR too)
Speed / capabilitySlower, 16-bit, limited addressable memoryFaster, supports larger disks and more memory, has its own mini file-browsing environment
Boot recordMBR — the first physical sector of the disk, containing both the bootloader and the partition tableGPT with an EFI System Partition (ESP) — a small FAT-formatted partition holding boot loader files
Security feature both supportA boot password can protect the boot process from unauthorized changes; UEFI additionally supports Secure Boot, which cryptographically verifies each boot component before it’s allowed to run

The Bootloader: GRUB2

Once firmware hands off, the bootloader — GNU GRUB2 on virtually every modern Linux distribution — finds and loads the kernel. Its components include the boot menu, kernel selection, and the ability to pass boot parameters.

GRUB2 gives administrators fine control over the boot process, boot devices, and boot behavior (rescue/single-user boots, kernel parameter overrides, dual-boot menus). We cover GRUB2’s configuration files and commands in the next lesson.


The Kernel, initramfs, and initrd

Once selected, the bootloader loads the kernel image — a compressed executable file containing the Linux kernel itself — into memory.

The kernel alone can’t mount the real root filesystem yet, because the drivers it needs to do so (storage controller drivers, filesystem drivers, LVM/RAID support) might not be built directly into it. That’s the job of a temporary root filesystem loaded into memory first:

TermWhat it is
initramfsA compressed cpio archive containing the essential files (drivers, tools) needed to mount the real root filesystem — the current standard approach
initrdThe older approach to the same problem, using a different mechanism (a full mountable filesystem image rather than an archive) — largely superseded by initramfs
mkinitrdBuilds an initrd image
dracut (produces mkinitramfs-style output)Builds an initramfs image, preloading the kernel modules needed at boot

Once the real root filesystem is mounted, the kernel discards the temporary root and hands off to the init system.


The 12(ish)-Step Boot Sequence

  1. Power on — hardware self-test (POST)
  2. Firmware (BIOS/UEFI) initializes and locates a boot device
  3. Firmware reads the boot record (MBR or the ESP/GPT boot entry)
  4. Bootloader (GRUB2) loads and displays its menu
  5. Bootloader loads the selected kernel image into memory
  6. Bootloader loads the initramfs into memory
  7. Kernel decompresses and initializes itself
  8. Kernel mounts the initramfs as a temporary root filesystem
  9. Kernel loads drivers/modules needed to reach the real root filesystem
  10. Kernel mounts the real root filesystem and discards the temporary one
  11. Kernel starts the init system (PID 1 — systemd on virtually all modern distributions)
  12. The init system brings the system up to its target run state, starting services until a login prompt (or graphical login) appears

When It Goes Wrong: Kernel Panic

A kernel panic is the mechanism by which the kernel detects it has hit a fatal, unrecoverable error and halts rather than risk further damage or data corruption. Common causes include a corrupted or missing root filesystem, a critical hardware failure, an incompatible or corrupted kernel module, or a bad initramfs.

⚠️ Common Pitfall: A Missing initramfs Looks Like a Much Scarier Problem

If a boot fails with errors about being unable to find or mount the root filesystem, don’t assume the disk itself has failed — check whether the initramfs is missing, corrupted, or simply doesn’t include the driver needed for that storage controller (common after migrating a VM between hypervisors, or upgrading storage hardware). Rebuilding it with dracut from a rescue environment is often the entire fix.


🧠 Knowledge Check

1. Put these in the correct order: firmware, kernel, bootloader, init system.

2. Why does the kernel need an initramfs before it can mount the real root filesystem?

3. A VM was just migrated to a hypervisor with a different virtual storage controller, and now it fails to boot with a 'cannot find root filesystem' error. What's the most likely first thing to check?


What’s Next

Lesson 2 goes deeper on the two systems that carry the boot process across that handoff line: GRUB2’s configuration, and systemd’s units and targets.