Fundamentals 9 min read

Mastering Linux Boot Process: From BIOS to systemd on CentOS 8

This guide walks through the Linux boot sequence on CentOS 8, detailing the BIOS/UEFI stage, GRUB2 configuration, kernel loading, initramfs, systemd target units, and essential commands for inspecting kernel version, CPU info, network parameters, and service management.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering Linux Boot Process: From BIOS to systemd on CentOS 8

System Directory Structure

The /boot directory on a typical CentOS 8 system contains kernel and initramfs images as well as bootloader configuration files.

[root@web01 boot]# ls
config-4.18.0-305.3.1.el8.x86_64          initramfs-4.18.0-305.3.1.el8.x86_64kdump.img
efi                                         loader
grub2                                       System.map-4.18.0-305.3.1.el8.x86_64
initramfs-0-rescue-4396f3518626409aa9770c4df8d21cb2.img  vmlinuz-0-rescue-4396f3518626409aa9770c4df8d21cb2
initramfs-4.18.0-305.3.1.el8.x86_64.img          vmlinuz-4.18.0-305.3.1.el8.x86_64
initramfs-4.18.0-305.3.1.el8.x86_64.img

: initramfs (initial RAM filesystem) used during early boot. vmlinuz-4.18.0-305.3.1.el8.x86_64: compressed Linux kernel image.

Kernel Version and CPU Information

# uname -r
4.18.0-305.3.1.el8.x86_64

# cat /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves arat umip pku ospke gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear flush_l1d arch_capabilities

Network Configuration and Kernel Parameters

Check and modify common networking sysctl settings.

# cat /proc/sys/net/ipv4/ip_forward
1   # 1 = enabled, 0 = disabled

# cat /proc/sys/net/ipv4/icmp_echo_ignore_all
1   # 1 = ignore (ping disabled), 0 = respond

# cat /etc/sysctl.conf
vm.dirty_expire_centisecs = 4500
net.ipv4.ip_forward = 0
net.ipv4.icmp_echo_ignore_all = 1

# sysctl -p   # reload changes immediately

Linux Boot Process Overview

1. BIOS / UEFI Stage

Hardware detection : Power‑on self‑test (POST) validates CPU, memory, and peripherals.

Boot device selection : Firmware chooses the device (disk, USB, network) from which to load the next stage.

2. Bootloader (GRUB2)

GRUB2 loads files from /boot and reads its configuration.

Typical commands in grub.cfg:

set root='hd0,msdos1'
search --no-floppy --fs-uuid --set=root ...

GRUB then loads the selected kernel image (e.g., vmlinuz-4.18.0-…) and passes control to it.

3. Kernel Loading and Initialization

The Linux kernel initializes hardware, memory management, and core drivers.

It mounts the initial RAM filesystem ( initramfs) which provides additional drivers and prepares the real root filesystem.

Finally, the kernel mounts the root filesystem as defined in /etc/fstab.

4. systemd Startup

systemd

becomes the first userspace process (PID 1) and takes over service management.

It mounts remaining filesystems, activates the default target unit ( graphical.target or multi-user.target), and starts essential services such as dbus.service, sshd.service, firewalld.service, and network managers.

5. Target Units

multi-user.target

: non‑graphical, equivalent to runlevel 3. graphical.target: graphical environment, depends on multi-user.target. basic.target, reboot.target, halt.target serve other lifecycle stages.

6. Service Startup

systemd starts services based on unit dependencies, e.g., dbus.service, sshd.service, firewalld.service, NetworkManager.service, and display managers like gnome-shell.service or lightdm.service.

7. User Login

Login manager (GDM, LightDM) presents a graphical login screen if a graphical target is active.

After authentication, the user session is started.

8. System Ready

When all units reach their active state without errors, the system is fully operational and ready for user interaction.

CentOS 8 Boot Example

GRUB Configuration File

# /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR='$(sed 's, release .*$,,g' /etc/system-release)'
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT='console'
GRUB_CMDLINE_LINUX='crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet'
GRUB_DISABLE_RECOVERY='true'
GRUB_ENABLE_BLSCFG=true

Updating GRUB

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
 done

Installing or Repairing the Bootloader

# grub2-install /dev/sda

Loading Kernel Modules

# lsmod          # list currently loaded modules
# modinfo kvm    # show detailed information about the kvm module

This step‑by‑step illustration shows how to inspect the bootloader configuration, regenerate the GRUB menu, install the bootloader on the disk, and query kernel modules on a CentOS 8 system.

KernelBoot ProcesssystemdgrubInitramfs
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.