USD ($)
$
United States Dollar
Euro Member Countries
India Rupee

System Boot Process and Runlevels

Lesson 44/49 | Study Time: 20 Min

The Linux system boot process and runlevels define the sequence in which the system starts up, initializes hardware and software components, and defines the operating state of the system.

Understanding the boot process and runlevels is essential for system administrators to troubleshoot startup issues, configure system states, and control how services and processes launch.

Modern Linux systems predominantly use systemd replacing the older SysV init and runlevels with targets and units.

Linux Boot Process 

The Linux boot process involves several sequential stages:


1. BIOS/UEFI Initialization: After the system is powered on, the BIOS or UEFI firmware performs the Power-On Self-Test (POST) to verify that essential hardware components are working correctly. It then locates and loads the bootloader from the disk or EFI system partition to begin the boot process.


2. Bootloader Execution (e.g., GRUB2): The bootloader loads the selected Linux kernel into memory along with the optional initramfs (initial RAM disk) image, which contains drivers and tools needed during early boot. It also presents a menu that allows users to choose between different kernels or operating systems.


3. Kernel Initialization: The Linux kernel decompresses itself and initializes core system components such as device drivers, memory management, and process scheduling. It mounts the root filesystem and starts essential kernel threads required for system operation.


4. systemd Initialization: Once the kernel setup is complete, it starts systemd as the first user-space process with process ID 1 (PID 1). systemd reads its unit configuration files and begins launching and managing all services, devices, mount points, and system targets.


5. Target Execution: systemd activates a specific target that defines the system’s operational mode, such as multi-user.target for a command-line multiuser environment or graphical.target for a full graphical interface. When the target is reached, the system is fully initialized and ready for use.

Runlevels and Systemd Targets

The following are the core operating states used by Linux systems. They show how runlevels evolved into systemd targets for better service management.


1. Traditional Linux uses runlevels (0-6) to define system states:


0: Halt

1: Single-user mode (maintenance)

2-5: Multi-user modes with varying configurations

6: Reboot


2. systemd replaces runlevels with targets:


poweroff.target: system shutdown

rescue.target: single-user mode

multi-user.target: multi-user, non-graphical

graphical.target: multi-user with GUI

reboot.target: reboot system


You can switch targets using:

text
sudo systemctl isolate multi-user.target

Managing Boot Targets and Services

Linux uses systemd targets to define different boot and runtime states. The following are commands used to view and configure these targets.


  •  View current target:
text
systemctl get-default


  • Set default target:
text
sudo systemctl set-default graphical.target


  • List all targets:
text
systemctl list-units --type=target

Troubleshooting and Special Modes


1. Single-user mode: For maintenance and recovery without networking.

2. Boot loader options allow selecting different kernels or rescue modes.

3. Use journalctl for boot logs:

text
journalctl -b
Samuel Wilson

Samuel Wilson

Product Designer
Profile

Class Sessions

1- What is Linux and Operating System Concepts 2- Linux History and Evolution 3- Linux Distributions and Their Purposes 4- Open Source Software and Licensing 5- Graphical User Interface (GUI) and Desktop Environments 6- Terminal Access and Command-Line Fundamentals 7- Getting Help and Command Documentation 8- File System Hierarchy and Directory Structure 9- Navigating Directories and Listing Contents 10- Creating, Copying, and Moving Files and Directories 11- Deleting Files and Directories 12- Symbolic and Hard Links 13- Understanding File Permissions Model 14- Modifying Permissions and Ownership 15- User and Group Management 16- Sudo and Privilege Escalation 17- Text Searching and Pattern Matching 18- Text Processing and Stream Editing 19- Compressing and Archiving Files 20- Text Editing and File Creation 21- Package Management Systems Overview 22- Installing and Updating Software with APT 23- Installing and Updating Software with YUM/DNF 24- Managing Software from Non-Repository Sources 25- Understanding Processes and Process Management 26- Viewing Running Processes 27- Process Control and Termination 28- Task Scheduling with Cron 29- Networking Concepts and IP Addressing 30- Viewing and Configuring Network Interfaces 31- Basic Network Troubleshooting 32- Shell Script Basics 33- Variables and Data Types 34- Conditional Logic in Scripts 35- Loops and Iteration 36- Functions and Code Reuse 37- Input/Output and User Interaction 38- System Authentication and Access Control 39- File System Security 40- Software Updates and Patching 41- Basic Firewall Concepts 42- System Information and Monitoring 43- Service and Daemon Management 44- System Boot Process and Runlevels 45- System Backup and Disaster Recovery 46- Comprehensive File System Management 47- System Automation Workflows 48- Multi-Concept Troubleshooting Scenarios 49- Continued Learning Pathways

Sales Campaign

Sales Campaign

We have a sales campaign on our promoted courses and products. You can purchase 1 products at a discounted price up to 15% discount.