Skip to content

15. The Boot Process

When a server crashes or fails to come back online after a restart, a SysAdmin must understand exactly how a Linux system boots in order to intervene at the correct stage.

The Linux boot process follows a strict, sequential chain of events. If any step fails, the next step cannot begin.

BIOS / UEFI (Hardware Initialization)
↓
Bootloader (GRUB)
↓
Kernel (Core OS loaded into memory)
↓
initramfs (Temporary initial filesystem)
↓
systemd (PID 1 - The Init System)
↓
Services (Daemons, Network, Mounts)
↓
Login (TTY / SSH available)

When power is applied to the motherboard, the firmware wakes up.

  • BIOS (Basic Input/Output System): The legacy standard. It performs a POST (Power-On Self Test) and looks for the MBR (Master Boot Record) on the first sector of the hard drive.
  • UEFI (Unified Extensible Firmware Interface): The modern standard. It reads the GPT (GUID Partition Table) and can understand filesystems well enough to load an .efi bootloader file directly.

The firmware’s only job is to find the bootloader. In Linux, this is almost always GRUB2 (GRand Unified Bootloader).

  • GRUB presents a menu allowing you to choose which OS or which specific Linux Kernel version you want to boot.
  • Once a selection is made (or a timeout is reached), GRUB loads the selected Kernel and the initramfs into memory.
  • The Kernel: The core of the operating system takes control from GRUB. It probes the hardware and initializes the CPU and memory.
  • initramfs (Initial RAM Filesystem): The kernel needs to mount the real root filesystem (/), but the drivers required to read your specific hard drive (e.g., RAID, LVM, or encrypted disks) live on that hard drive! The initramfs is a tiny, temporary filesystem loaded into RAM that contains just enough drivers and kernel modules to find and mount the real / drive.

Once the real root filesystem is mounted, the Kernel executes the very first process: PID 1. On modern systems, this is systemd.

  • systemd takes over the boot process and begins spawning all other processes concurrently.

Instead of legacy “Runlevels,” systemd boots to a specific Target.

  • systemd looks at its default target (usually multi-user.target for servers, or graphical.target for desktops).
  • It then calculates the dependencies for that target and starts all the required .service, .socket, and .mount units.

Once the target is reached, systemd spawns getty processes for the physical TTY consoles and starts the sshd service, finally allowing users to log in.

If a system won’t boot, you must intervene at the GRUB menu.

If a bad service or configuration is preventing the server from booting completely, you can boot into a restricted environment.

  1. Reboot the server.
  2. When the GRUB menu appears, press e to edit the boot parameters.
  3. Find the line that starts with linux.
  4. Append systemd.unit=rescue.target to the end of the line.
  5. Press Ctrl + X to boot. This drops you into a root shell with the filesystem mounted, allowing you to fix broken configurations or disable crashing services before returning to a normal boot.

If the system cannot even mount the root filesystem (e.g., due to /etc/fstab errors), you need Emergency Mode.

  • Follow the same steps above, but append systemd.unit=emergency.target.
  • In this mode, the root filesystem is mounted as Read-Only. You must manually remount it as Read-Write (mount -o remount,rw /) to fix your /etc/fstab errors.

If the system successfully booted but you suspect something failed along the way, you can read the kernel ring buffer and the systemd journal:

Terminal window
# View kernel hardware/driver initialization logs
dmesg | less
# View the systemd boot logs for the current boot
journalctl -b