Maintenance

Site is under maintenance — quizzes are still available.

Go to quizzes
Sponsored Reserved space — layout preview until AdSense is connected

Tech

From Zero to Login: The Full Journey of a Linux System Boot

A comprehensive walkthrough of the Linux boot sequence, from BIOS/UEFI initialization and GRUB to the kernel, initramfs, and systemd.

June 2026 · 7 min read · 1 views · 0 hearts

From Zero to Login: The Full Journey of a Linux System Boot

If you've ever wondered what exactly happens between pressing the power button and seeing your desktop environment or shell prompt, you're about to get the full story. The Linux boot process is a carefully orchestrated sequence where each component hands off to the next like a relay race. Understanding this chain isn't just academic — it's the key to debugging boot failures, optimizing startup times, and building custom embedded systems.

Here's the complete journey, step by step.

Step 1: Power On and BIOS/UEFI Initialization

The moment you press the power button, electricity flows to the motherboard's firmware. This is either the traditional BIOS (Basic Input/Output System) or the modern UEFI (Unified Extensible Firmware Interface). The firmware's first job is Power-On Self-Test (POST) — checking that RAM, storage devices, and other essential hardware are functional and present.

What's happening under the hood: - The firmware checks a predefined boot order (e.g., USB → SSD → Network). - It looks for a valid boot sector or EFI System Partition on the selected device. - In UEFI systems, it reads NVRAM variables to find the bootloader.

If POST fails, you'll hear beep codes or see error messages. If it passes, the firmware loads the bootloader from disk into RAM and jumps to it. This is the end of firmware's role.

Step 2: The Bootloader Takes Over (GRUB, systemd-boot, etc.)

The bootloader is the first piece of Linux software that runs. The most common is GRUB 2 (GRand Unified Bootloader), though modern systems also use systemd-boot, especially on UEFI.

What GRUB does: - It reads its configuration from /boot/grub/grub.cfg - It presents a menu of available kernels (if you have multiple installed) - You can press e to edit boot parameters (handy for recovery mode) - It loads the selected Linux kernel image (vmlinuz) and an initial RAM filesystem (initramfs) into memory

The critical trick: GRUB doesn't know about filesystems like ext4 by default — it uses its own drivers to read /boot. Once the kernel and initramfs are loaded, GRUB jumps to the kernel entry point and hands off control.

Step 3: Kernel Initialization — The Most Intense Moment

When the kernel starts, it can't do much — it has no memory management, no process scheduler, no filesystem support yet. It must bootstrap itself.

The kernel's startup sequence includes: - Setting up interrupt handlers (IDT) - Initializing memory management (page tables, buddy allocator) - Detecting and configuring CPU cores (SMP brings up secondary cores) - Enumerating hardware via ACPI or Device Tree - Mounting a temporary root filesystem from the initramfs

The initramfs is a compressed archive (sometimes just initramfs-*.img) that contains essential kernel modules and a minimal userspace. Why? Because the kernel can't access your actual root filesystem yet — the storage driver might be a module, or the filesystem driver (e.g., for Btrfs or ZFS) isn't built into the kernel. The initramfs solves this chicken-and-egg problem.

Step 4: initramfs — The Minimal Rescue System

The initramfs isn't a permanent system — it's a temporary scaffolding. Inside it, a tiny program (often a shell script or a small binary like busybox) runs and does critical work:

  • Loads necessary kernel modules (e.g., ahci for SATA, nvme for NVMe)
  • Detects the root filesystem device (using UUID or labels)
  • Handles encryption (LUKS) — prompts for password if needed
  • Sets up RAID or LVM logical volumes
  • Mounts the real root filesystem at /sysroot

Once the real root is mounted, the initramfs switches to it via switch_root — the pivot point where the actual operating system takes over. This is essentially like swapping out a temporary scaffold for the real building.

Step 5: init (Systemd, SysVinit, or OpenRC)

Now we're on the real root filesystem. The kernel executes the first userspace process — traditionally /sbin/init, but on modern systems this is a symlink to /lib/systemd/systemd (if using systemd) or another init system.

Systemd is the most common today. Its first job: - Reads default.target (usually a symlink to multi-user.target or graphical.target) - Mounts filesystems listed in /etc/fstab (except those already mounted by initramfs) - Starts udev (device manager) for hotplug support - Launches systemd-journald (logging) - Activates socket-based services

Systemd parallelizes service startup aggressively — unlike SysVinit's sequential script execution. This is why modern Linux boots fast even with dozens of services.

Step 6: Service and Daemon Startup

This is where the system becomes functional. Services include: - sshd (SSH server) — remote access - NetworkManager or systemd-networkd — networking - cron / systemd-timers — scheduled tasks - Display managers like gdm or sddm (for graphical)

Each service has a unit file (.service) that defines dependencies, start commands, and failure behaviors. Systemd tracks dependencies and orders startup accordingly — for example, NetworkManager only starts after the network target is reached.

Step 7: Display Manager and Login

If your system boots to a graphical environment, the display manager starts last. You'll see a login screen (GDM, SDDM, LightDM). After authentication, it starts your desktop environment (GNOME, KDE, XFCE) or window manager.

On headless servers, you get a text login prompt (getty on a TTY). Either way, you've reached the fully operational state.

Step 8: Post-Boot — But Wait, There's More

Booting doesn't end at login. Many systems run startup scripts or systemd oneshots afterwards: - User systemd services (systemctl --user) - Cron jobs at @reboot - Docker containers with restart: always policy

Also, the kernel continues working — scheduling processes, managing hardware interrupts, handling network packets. The boot sequence is over, but the kernel's real job has just begun.


Where Things Break (and How to Fix)

Understanding the boot chain helps you diagnose failures:

Symptom Likely Fault
Black screen after POST Bootloader corrupt or missing GRUB
"Kernel panic - not syncing" Corrupted kernel or missing initramfs
Emergency mode / fallback shell Root filesystem not found (wrong UUID in fstab)
Stuck at "Started User Manager" Display manager or GPU driver crash

Pro tip for recovery: Most bootloaders let you append init=/bin/sh to kernel parameters, dropping you into a root shell. From there you can fix fstab, repair GRUB, or reinstall packages — even without a working init system.

The Linux boot process is a masterclass in modular design. Each component is replaceable — you can swap GRUB for LILO, systemd for runit, even write your own initramfs. Knowing the full journey gives you the confidence to debug, optimize, and customize at every level.

Comments

Questions, corrections, and tips stay visible for everyone reading this page.

0 in thread

Join the discussion

Shown next to your comment.

Up to 4,000 characters

No comments yet

Be the first to leave a note — it helps the next reader.