Back to notes
Systems· 1 min read
Understanding the Linux boot process
BIOS to shell, one stage at a time.
Overview
Every time you press the power button, a remarkable sequence of handoffs happens before you see a shell prompt. Understanding each stage demystifies kernel panics, GRUB misconfiguration, and systemd races.
The stages
- BIOS / UEFI — firmware initialises hardware, runs POST, loads the bootloader from the ESP
- GRUB — reads
/boot/grub/grub.cfg, loads the kernel image (vmlinuz) and initramfs into RAM - Kernel initialisation — decompresses itself, sets up virtual memory, detects CPUs and devices
- initramfs — a tiny root filesystem that mounts the real root partition (handles LUKS, LVM, etc.)
- PID 1 / systemd — takes over, activates units in parallel based on
Wants=/Requires=dependencies - Login shell —
gettyspawns on TTYs;sddm/gdmon graphical targets
Why this matters
Knowing the boot sequence means you can recover from any broken stage. GRUB won’t load? Boot a live USB and chroot. initramfs panics? Add break=premount to the kernel cmdline and drop into a debug shell.