The Linux boot sequence can seem like magic, but it's actually a well-defined chain of events. Here's a clear, step-by-step breakdown of what happens from the moment you press the power button to when you see the login prompt.
1. Power-On and BIOS/UEFI
When you power on the machine, the BIOS (Basic Input/Output System) or its modern counterpart UEFI (Unified Extensible Firmware Interface) takes control. It performs a Power-On Self-Test (POST) to check hardware components like RAM, CPU, and storage devices. Then it looks for a bootable device—typically the hard drive or SSD—based on a configured order.
2. Boot Loader Stage: GRUB
Once a bootable device is found, the BIOS/UEFI loads the first sector of that disk, which contains the boot loader. Most Linux distributions use GRUB (Grand Unified Bootloader). GRUB displays a menu (if configured) allowing you to choose an operating system or kernel. It then loads the selected Linux kernel and an initial RAM disk (initrd or initramfs) into memory.
3. Kernel Initialization
The kernel decompresses itself and begins hardware initialization. It sets up memory management, detects devices (via drivers either built-in or from initramfs), and mounts the root filesystem (usually from the initramfs as a temporary filesystem). The kernel then starts the first userspace process: /sbin/init.
4. Systemd (or Init) Takes Over
Modern Linux systems use systemd as the init system (older ones use SysV init). Systemd executes the default target (e.g., graphical.target or multi-user.target), which triggers a series of service units. These services handle filesystem checks, mount permanent partitions, start networking, load drivers, and launch display managers.
5. Display Manager and Login
For desktop systems, the display manager (like GDM, SDDM, or LightDM) starts, presenting a graphical login screen. For server systems, you get a virtual terminal login prompt (login:). Once you authenticate, the session manager starts your desktop environment or shell, and you're ready to work.
Understanding each step helps with troubleshooting boot issues and gives you a deeper appreciation for the OS you use every day.