🚀 Demystifying the Linux Boot Process and Runlevels (Targets)

Table of contents
- A Beginner’s Guide to How Linux Starts and Switches Modes
- Online Linux Terminal and Playground
- 🧩 Introduction: Why Learn the Linux Boot Sequence?
- 🧬 Stage 1: BIOS and POST (Power-On Self-Test)
- 🗃️ Stage 2: Boot Loader (GRUB2 in Linux)
- 🧠 Stage 3: Kernel Initialization
- 🧩 Stage 4: INIT System and systemd
- 🔄 Understanding Runlevels (Targets) in Linux
- ⚙️ Checking the Current Runlevel (Target)
- 🔧 Switching Between Targets (Runlevels)
- 📋 Summary of Key Commands
- 🧠 Final Thoughts: Why It Matters

A Beginner’s Guide to How Linux Starts and Switches Modes
Online Linux Terminal and Playground
The LabEx Online Linux Terminal offers a comprehensive online Linux terminal and sandbox environment, providing users with a full Linux experience without local setup requirements. This versatile platform caters to Linux beginners, system administrators, and developers alike, offering an ideal space for exploration and experimentation with various Linux technologies.
https://labex.io/tutorials/linux-online-linux-playground-372915
🧩 Introduction: Why Learn the Linux Boot Sequence?
Understanding the Linux boot process is essential for anyone stepping into system administration or DevOps. When a Linux machine starts, it goes through several carefully orchestrated stages — from hardware checks to fully launching the user interface or command-line environment.
In this blog, we'll walk through each stage of the boot process, explain how runlevels (also called targets) work in modern Linux systems, and compare how this differs from Windows startup mechanisms. Whether you're a curious beginner or prepping for certifications, this guide will ground you in core Linux concepts.
🧬 Stage 1: BIOS and POST (Power-On Self-Test)
When you power on your computer, the BIOS (Basic Input/Output System) performs a POST — a quick diagnostic test.
🛠️ What it checks:
RAM
Keyboard and Mouse
Disk Drives
CPU
If everything passes, BIOS hands control over to the boot loader.
🪟 Windows Comparison:
Windows also performs a POST via BIOS or UEFI, but this process is hidden from the user with a branded splash screen.
🗃️ Stage 2: Boot Loader (GRUB2 in Linux)
After POST, BIOS looks for a bootable device (like your hard disk or SSD) and executes the boot loader code.
On Linux systems, this is most commonly:
📍 GRUB2 – Grand Unified Bootloader v2
🔍 GRUB2 Location: /boot/grub2/
🧭 What GRUB2 Does:
Presents a boot menu (in multi-OS systems)
Loads the Linux kernel into memory
Passes control to the kernel
🪟 Windows Comparison:
Windows uses BOOTMGR and BCD (Boot Configuration Data) instead of GRUB. It's less flexible and harder to customize than GRUB2.
🧠 Stage 3: Kernel Initialization
Once loaded into memory, the Linux kernel:
Initializes device drivers
Sets up memory and CPU scheduling
Mounts the root filesystem
Prepares the environment for user processes
📦 At the end of this stage, the kernel looks for the init system, typically /sbin/init
, to continue the boot process.
🧩 Stage 4: INIT System and systemd
Historically, Linux used SysV-Init, but modern distributions (like Ubuntu, RHEL 7+, Fedora, CentOS 7+) use systemd.
👨💻 What systemd Does:
Mounts file systems
Starts essential services (network, ssh, etc.)
Spawns user login processes (GUI or CLI)
🔎 Check which init system you're using:
ls -l /sbin/init
🧾 Output:
lrwxrwxrwx 1 root root 20 /sbin/init -> /lib/systemd/systemd
This shows that init
is linked to systemd
.
🪟 Windows Comparison:
Windows uses the Windows Services Manager and Task Scheduler, but lacks a unified init system like systemd
.
🔄 Understanding Runlevels (Targets) in Linux
In the SysV-Init days, Linux had numeric runlevels:
Runlevel | Purpose |
0 | Halt (Shutdown) |
1 | Single-user mode |
3 | Multi-user (No GUI) |
5 | Multi-user with GUI |
6 | Reboot |
Now, with systemd, these are replaced by targets, but the idea remains the same — determine what system services and interfaces are started.
⚙️ Checking the Current Runlevel (Target)
🔍 Command:
systemctl get-default
🧾 Output Example:graphical.target
This shows the system boots into GUI mode by default.
🧠 Behind the scenes:/etc/systemd/system/
default.target
is a symlink to the actual target unit (e.g., /lib/systemd/system/
graphical.target
).
🔧 Switching Between Targets (Runlevels)
To change the default runlevel (target):
Example: Switch from GUI (5) to CLI (3)
sudo systemctl set-default multi-user.target
To reboot into that mode:
sudo reboot
Want to temporarily switch without changing defaults?
sudo systemctl isolate multi-user.target
🧾 Back to GUI:
sudo systemctl isolate graphical.target
🪟 Windows Comparison:
Windows doesn’t offer this flexibility natively. You can't boot directly into a command-line interface unless you're in Safe Mode or use PowerShell manually.
📋 Summary of Key Commands
Command | Description |
ls -l /sbin/init | Show which init system is in use |
systemctl get-default | Display current default runlevel (target) |
systemctl set-default multi-user.target | Set CLI as the default target |
systemctl isolate graphical.target | Temporarily switch to GUI mode |
sudo reboot | Reboot into new target |
🧠 Final Thoughts: Why It Matters
The Linux boot process and runlevels are critical to understanding how your system starts, how services are managed, and how you can optimize or troubleshoot system behavior.
Whether you're recovering a broken system, setting up a headless server, or simply trying to deepen your Linux knowledge, knowing what happens from the moment you hit the power button is empowering.
🔧 And unlike Windows, Linux gives you full visibility and control over each step.
Subscribe to my newsletter
Read articles from Sahitya Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
