The Linux Boot Process Explained: From Firmware to systemd
Follow a Linux machine from power-on to login: UEFI/BIOS, GRUB, kernel, initramfs, systemd and targets, with the commands to inspect each stage.
Published November 27, 2026
Every time you press the power button, a Linux machine runs through a precise relay race: firmware hands off to a bootloader, the bootloader loads the kernel, the kernel unpacks an initramfs, and finally systemd starts your services. When boot fails, knowing which runner dropped the baton tells you exactly where to look.
The concept
Stage one is firmware. Older PCs use BIOS, which reads the first 512-byte sector of the boot disk (the MBR) and jumps to it. Modern machines use UEFI, which understands partitions and filesystems natively and loads a bootloader file (for example \EFI\ubuntu\shimx64.efi) from the FAT-formatted EFI System Partition. UEFI also implements Secure Boot, verifying signatures before running anything.
Stage two is the bootloader, usually GRUB 2. It shows the menu, reads its configuration, loads the kernel image (vmlinuz) and the initial RAM filesystem (initrd/initramfs) into memory, and passes the kernel command line such as root=UUID=... ro quiet.
Stage three is the kernel. It decompresses itself, initialises CPU, memory and built-in drivers, then unpacks the initramfs and runs its /init. The initramfs exists to load whatever is needed to reach the real root filesystem: storage drivers, LVM, RAID, LUKS decryption, network roots. Once the real root is mounted, control passes to /sbin/init, which on almost all distributions is systemd, and systemd brings the system up to its default target.
The boot relay
- Firmware (UEFI/BIOS): POST, find boot entry, Secure Boot checks
- Bootloader (GRUB): menu, load vmlinuz + initramfs, pass cmdline
- Kernel: hardware init, mount initramfs as temporary root
- initramfs: load storage drivers, unlock LUKS, assemble LVM/RAID, mount real root
- systemd (PID 1): mount filesystems, start units, reach default.target
Who hands off to whom
What fails where
| Stage | Typical failure | Where to look |
|---|---|---|
| Firmware | No bootable device, Secure Boot violation | Firmware setup, efibootmgr -v |
| GRUB | grub rescue> prompt, missing kernel | grub.cfg, /boot partition |
| Kernel | Kernel panic: VFS unable to mount root | root= parameter, initramfs drivers |
| initramfs | Dropped to (initramfs) shell, LUKS/LVM issues | Rebuild initramfs, check UUIDs |
| systemd | Emergency mode, failed units, fstab errors | journalctl -xb, systemctl --failed |
Measuring each stage
Practical examples
Inspect UEFI boot entries
Shows the boot order and which .efi file each entry runs.
sudo efibootmgr -v
# Boot0001* ubuntu HD(1,GPT,...)/File(\EFI\ubuntu\shimx64.efi)Look inside the initramfs
See which drivers and scripts will run before root is mounted.
lsinitramfs /boot/initrd.img-$(uname -r) | grep -E 'nvme|lvm|cryptsetup' | head
# RHEL: lsinitrd /boot/initramfs-$(uname -r).imgRead logs from the previous boot
Persistent journal required (Storage=persistent).
journalctl -b -1 -p err
journalctl --list-boots | tail -3Common mistakes
- Assuming GRUB problems and kernel problems are the same thing. A grub rescue prompt and a kernel panic point to completely different stages.
- Changing disk layout or UUIDs without updating /etc/fstab and the initramfs.
- Disabling Secure Boot permanently to work around one unsigned module instead of signing it.
- Blaming slow boot on the kernel when systemd-analyze shows a network-wait service taking most of the time.
Key takeaways
- Boot goes firmware → bootloader → kernel → initramfs → systemd.
- UEFI loads .efi files from the EFI System Partition; BIOS reads the MBR.
- The initramfs exists to mount the real root filesystem.
- systemd-analyze, journalctl -b and /proc/cmdline are your stage-by-stage debugging tools.
FAQ
What is vmlinuz?
The compressed, bootable Linux kernel image. The z means it is compressed; the kernel decompresses itself at the start of boot.
Is the initramfs always required?
No. If every driver needed to mount root is built into the kernel and there is no LUKS/LVM, the kernel can mount root directly. Distribution kernels use one because their drivers are modular.
What is the difference between a target and a runlevel?
systemd targets replace SysV runlevels: multi-user.target is roughly runlevel 3 and graphical.target roughly runlevel 5.