What Happens When You Power On a Linux PC? A Deep Dive into the Boot Process
This guide walks through the four essential stages of a Linux system’s startup—BIOS POST, the GRUB2 bootloader, kernel initialization, and systemd—explaining each step, the commands used to inspect targets, and how the process culminates in the user login prompt.
When you power on a Linux PC it passes through four main stages before showing the login prompt.
These stages are BIOS integrity check (POST), the GRUB2 bootloader, kernel initialization, and the systemd init system.
BIOSperforms the Power‑On Self Test ( POST) to verify hardware components such as HDD/SSD, RAM, keyboard, USB ports, etc.
The bootloader GRUB2 is loaded from the Master Boot Record ( MBR) and presents a menu that lets you select the kernel version or another operating system.
The selected Linux kernel decompresses itself, mounts the initial RAM disk ( initrd), and starts the first user‑space process init (PID 1), which mounts filesystems defined in /etc/fstab.
Finally, systemd takes over as the parent of all processes, reads /etc/systemd/system/default.target to determine the default target (e.g., graphical.target for desktops or multi‑user.target for servers), and launches the remaining services.
1. BIOS Integrity Check (POST)
POST runs when the power button is pressed, checking hardware components. If a component fails, an error message or beep may appear.
2. Bootloader (GRUB2)
After POST, BIOS reads the MBR to locate the bootloader. GRUB2 can reside on a hard‑disk, Live USB, or DVD. It replaces older loaders such as LILO and GRUB.
The GRUB2 menu lets you choose a kernel version or another OS and edit kernel parameters.
3. Kernel Initialization
The kernel is the core of Linux, linking hardware to processes. After the bootloader loads the kernel, it decompresses, mounts the initial RAM disk, and starts init (PID 1), which spawns daemons and mounts partitions from /etc/fstab.
4. Starting systemd
Systemd replaces the traditional SysV init. It is the parent of all processes and manages mounting, service start/stop, etc. The default target is defined in /etc/systemd/system/default.target. Desktop systems default to graphical.target (runlevel 5); servers default to multi‑user.target (runlevel 3). poweroff.target (runlevel 0) – shut down. rescue.target (runlevel 1) – rescue shell. multi‑user.target (runlevels 2‑4) – non‑graphical multi‑user. graphical.target (runlevel 5) – graphical UI. reboot.target (runlevel 6) – reboot.
Check the current default target with: systemctl get-default Switch targets using: init runlevel-value For example, init 3 switches to a non‑graphical state, while init 6 reboots and init 0 powers off. Use sudo when changing targets.
When systemd finishes loading all services and sets the target, the boot process ends and the login prompt appears.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
