System Administration

Linux Boot Process Cheatsheet

Comprehensive reference for Linux boot process covering BIOS/UEFI initialization, hardware detection, bootloader (GRUB2), kernel loading, system initialization with systemd/init, and startup scripts. Essential for system administrators and troubleshooting boot issues.

#linux #boot-process #systemd #grub #bios #uefi #kernel #sysadmin

Before you dive into firmware hand-offs, stop by our main hub and monitor live infrastructure trends on the performance dashboard to see how boot tuning impacts real VPS workloads.

Need lab hardware recommendations? Browse the benchmark library, compare candidate nodes in the VPS comparison tool, and vet each vendor through the provider directory.

Sign In to Download

Free account required

Linux Boot Process Flow

Power On
BIOS/UEFI
Boot Loader
Kernel
Init/systemd
Running System

1. BIOS/UEFI Initialization

First Stage: When you power on your computer, the BIOS or UEFI firmware is loaded from non-volatile RAM (NVRAM).

Power-On Self-Test (POST)

The BIOS/UEFI performs a Power-On Self-Test to verify hardware components are functioning correctly.

  • Checks CPU, RAM, and storage devices
  • Initializes hardware components
  • Tests keyboard and display
  • Detects connected peripherals

Hardware Detection & Initialization

The firmware probes and detects hardware components connected to the system.

  • CPU detection and initialization
  • Memory (RAM) detection and configuration
  • Storage devices (HDD, SSD, NVMe)
  • Network interfaces and peripherals

Boot Device Selection

After hardware detection, the BIOS/UEFI allows you to select the boot device from available options.

BIOS Boot Order
Legacy MBR-based boot from local disk, USB, or network (PXE)
UEFI Boot Manager
Loads boot entries from EFI System Partition (ESP)

UEFI vs BIOS Comparison

Feature BIOS (Legacy) UEFI (Modern)
Partition Scheme MBR GPT
Max Disk Size 2 TB 9.4 ZB
Boot Mode 16-bit mode 32/64-bit mode
Secure Boot Not supported Supported
Interface Text-based GUI + Mouse support

While you are adjusting firmware policies, keep our Linux diagnostics toolkit close for quick POST and hardware checks, and revisit the Linux admin tips cheatsheet to document the services that must come back online once the kernel hands off control.

2. Boot Loader (GRUB2)

Second Stage: The BIOS/UEFI loads the boot loader. In most Linux systems, GRUB2 (GRand Unified Bootloader) is commonly used.

GRUB2 Boot Process

GRUB or the chosen boot loader determines which Linux kernel to load.

  • Reads boot configuration from /boot/grub/grub.cfg
  • Displays boot menu with available kernels
  • Allows kernel parameter customization
  • Supports multiple operating systems (dual boot)

Important GRUB2 Files

/boot/grub/grub.cfg Main GRUB2 configuration file (auto-generated)
/etc/default/grub User-editable GRUB2 settings
/etc/grub.d/ Scripts used to generate grub.cfg
/boot/efi/ EFI System Partition (UEFI systems)

Common GRUB2 Commands

Update GRUB configuration
$ sudo update-grub              # Debian/Ubuntu
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg  # RHEL/CentOS
Install GRUB to disk
$ sudo grub-install /dev/sda    # BIOS
$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi  # UEFI
List available kernels
$ ls /boot/vmlinuz-*

Kernel Selection

GRUB determines which kernel to boot based on its configuration and user selection.

  • Default kernel specified in /etc/default/grub
  • Kernel version typically specified (e.g., vmlinuz-5.15.0)
  • Initial ramdisk (initrd/initramfs) loaded with kernel
  • Kernel parameters passed (e.g., root filesystem location)

Coordinating multi-boot fleets? Check recent CPU and disk scores in the VPS benchmark library, line up providers in the comparison tool, and review firmware support notes inside our provider directory before promoting a GRUB change to production.

3. Kernel Loading & Initialization

Third Stage: The boot loader loads the selected Linux kernel into memory. The kernel is the core of the operating system.

Load the Selected Kernel

The boot loader loads the selected Linux kernel into memory.

  • Kernel image loaded from /boot/vmlinuz-*
  • Initial RAM disk loaded from /boot/initrd.img-*
  • Kernel is responsible for hardware initialization
  • Manages system resources and device drivers

Kernel Files Location

$ ls -lh /boot/
-rw-r--r-- 1 root root 8.9M vmlinuz-5.15.0-91-generic        # Kernel image
-rw-r--r-- 1 root root  85M initrd.img-5.15.0-91-generic     # Initial RAM disk
-rw-r--r-- 1 root root 256K config-5.15.0-91-generic         # Kernel config
-rw-r--r-- 1 root root 9.2M System.map-5.15.0-91-generic     # Kernel symbol table

Initialize Kernel Data Structures

After loading, the kernel initializes its data structures, sets up memory management, and prepares for user space transition.

  • Memory management subsystem initialization
  • Process scheduler setup
  • Virtual file system (VFS) initialization
  • Device driver loading and hardware detection
  • Mount root filesystem (specified by kernel parameters)

Initial RAM Disk (initrd/initramfs)

A temporary root filesystem loaded into memory containing essential drivers and tools.

Purpose:
  • Contains drivers needed to access root filesystem
  • Provides modules for disk controllers, RAID, LVM, encryption
  • Executed before real root filesystem is mounted
  • Switches to actual root filesystem after initialization

View Kernel Boot Messages

$ dmesg | less              # View kernel ring buffer
$ dmesg | grep -i error     # Check for errors
$ journalctl -k             # View kernel logs (systemd)
$ cat /var/log/kern.log     # Kernel log file

After the system is back online, validate connectivity with the IP command cheatsheet, audit services using our server tooling suite, and keep security hardening on track with the ethical hacking roadmap.

4. Init System (systemd / SysVinit)

Fourth Stage: The kernel starts the init system or systemd as the first user-space process (PID 1).

Start Init/systemd as PID 1

The kernel starts the init system or systemd as the first user-space process (PID 1).

  • First process launched in user space
  • Parent of all other processes
  • Responsible for system initialization
  • Modern distributions use systemd, legacy systems use SysVinit

systemd (Modern Init System)

In modern Linux distributions, systemd has become the default init system, responsible for managing system services and processes.

Key Features:
  • Parallel service startup (faster boot times)
  • On-demand daemon starting
  • Dependency-based service management
  • Unified logging with journald
  • Socket and D-Bus activation
Common systemd Commands:
$ systemctl status                    # View system status
$ systemctl list-units                # List active units
$ systemctl start service.service     # Start a service
$ systemctl stop service.service      # Stop a service
$ systemctl enable service.service    # Enable at boot
$ systemctl disable service.service   # Disable at boot
$ systemctl restart service.service   # Restart service
$ systemctl daemon-reload             # Reload systemd configuration

systemd Targets (Runlevels)

systemd uses "targets" instead of traditional runlevels to define system states.

Target Legacy Runlevel Description
poweroff.target 0 Shutdown system
rescue.target 1 Single user mode
multi-user.target 3 Multi-user, no GUI
graphical.target 5 Multi-user with GUI
reboot.target 6 Reboot system
$ systemctl get-default                           # Check current default target
$ systemctl set-default multi-user.target         # Set default target
$ systemctl isolate multi-user.target             # Switch to target now

Important systemd Directories

/etc/systemd/system/ System administrator unit files
/lib/systemd/system/ Package-installed unit files
/run/systemd/system/ Runtime unit files

5. Execute Startup Scripts & Services

Fifth Stage: The init system or systemd executes startup scripts and initializes system services and daemons.

Service Initialization

These scripts and services include those responsible for:

  • Setting up networking (NetworkManager, dhclient)
  • Mounting filesystems (/etc/fstab)
  • Starting SSH daemon (sshd)
  • Configuring firewall rules (iptables, firewalld)
  • Launching web servers (Apache, Nginx)
  • Database services (MySQL, PostgreSQL)
  • Cron daemon for scheduled tasks
  • Display manager (GDM, LightDM for GUI)

Analyze Boot Time

systemd provides tools to analyze boot performance and identify slow services.

$ systemd-analyze                      # Show total boot time
$ systemd-analyze blame                # List services by init time
$ systemd-analyze critical-chain       # Show critical path
$ systemd-analyze plot > boot.svg      # Generate boot time graph

Common System Services

sshd.service SSH daemon for remote access
NetworkManager.service Network connection manager
cron.service Scheduled task daemon
rsyslog.service System logging daemon
firewalld.service Firewall management

Mounting Filesystems

The system mounts filesystems defined in /etc/fstab

$ cat /etc/fstab
# Example fstab entries:
UUID=abc-123  /          ext4    defaults        0 1
UUID=def-456  /home      ext4    defaults        0 2
UUID=ghi-789  /boot/efi  vfat    umask=0077      0 1
UUID=jkl-012  swap       swap    defaults        0 0
$ mount                   # View mounted filesystems
$ df -h                   # Check disk space usage
$ findmnt                 # Show filesystem tree

6. Running System

Final Stage: Once all initialization and startup tasks are completed, the Linux system is fully booted and ready to use.

System Ready

At this point:

  • Users can log in and the system is in a running state
  • All enabled services are running
  • Network connections are established
  • Filesystems are mounted and accessible
  • System is ready to perform tasks
  • GUI login manager displays (if graphical.target)

Check System Status

$ uptime                              # System uptime and load
$ who                                 # Currently logged in users
$ systemctl status                    # System and service status
$ journalctl -b                       # Boot messages
$ ps aux                              # Running processes
$ top                                 # Real-time process monitor

7. Boot Troubleshooting

Common Boot Issues

GRUB Not Found
Bootloader is missing or corrupted
# Boot from live USB, then:
$ sudo mount /dev/sda1 /mnt
$ sudo grub-install --root-directory=/mnt /dev/sda
$ sudo update-grub
Kernel Panic
Kernel fails to initialize or mount root filesystem
  • Try booting with older kernel from GRUB menu
  • Check root= kernel parameter in GRUB
  • Verify /etc/fstab entries are correct
  • Boot with init=/bin/bash for emergency shell
Service Failed to Start
System boot but a service won't start
$ systemctl status service-name.service    # Check status
$ journalctl -u service-name.service       # View logs
$ systemctl disable service-name.service   # Disable problematic service

Boot into Recovery Mode

Access recovery mode for system repair and troubleshooting.

Method 1: GRUB Menu
  1. Restart and hold Shift (BIOS) or Esc (UEFI) to show GRUB
  2. Select "Advanced options"
  3. Choose "Recovery mode" or similar option
Method 2: Kernel Parameter
Press 'e' in GRUB and add to kernel line:
systemd.unit=rescue.target     # Single user mode
systemd.unit=emergency.target  # Minimal environment

View Boot Logs

$ journalctl -b                    # Current boot
$ journalctl -b -1                 # Previous boot
$ journalctl -p err                # Show only errors
$ journalctl --list-boots          # List all boots
$ dmesg                            # Kernel messages
$ less /var/log/boot.log           # Boot log (if available)

fsck - File System Check

Check and repair filesystem errors that may prevent booting.

# Boot into recovery mode or live USB
$ sudo fsck /dev/sda1              # Check filesystem
$ sudo fsck -y /dev/sda1           # Auto-repair errors
$ sudo e2fsck -f /dev/sda1         # Force check ext4

Warning: Never run fsck on mounted filesystems. Unmount first or use recovery mode.

Master Linux System Administration

Understanding the boot process is essential for troubleshooting. Deploy your Linux systems on reliable VPS infrastructure with proven performance.

Want to understand our methodology? Meet the team on the About page, and share your boot troubleshooting story through the contact form. Handling production logs or customer data? Review the safeguards in our privacy policy before capturing diagnostics.

Keep tuning your fleet with live metrics from the performance dashboard, bookmark the Linux networking cheatsheet for post-boot checks, and explore orchestration strategies in the cloud platform models guide.