Understanding Linux Kernel and CentOS Boot Process: A Complete Guide
This article explains the Linux kernel architecture, key components, and the detailed CentOS boot sequence—from hardware POST and BIOS to GRUB stages, kernel initialization, runlevel configuration, and system initialization scripts—providing a comprehensive overview of OS startup fundamentals.
1. Linux Kernel Components
The Linux system consists of the kernel and the root file system. The kernel handles process management, memory management, network protocol stack, file systems, and device drivers. IPC (Inter‑Process Communication) includes Unix IPC, System V IPC, socket‑based IPC, and POSIX IPC.
Running environments are divided into kernel space (kernel code and system calls) and user space (applications, processes, or threads). Kernel design styles include monolithic kernels (e.g., Linux) and microkernels (e.g., Windows). Linux kernels support modularity via .ko files and allow dynamic loading/unloading of modules.
Key kernel files include /boot/vmlinuz‑VERSION‑release and initramfs images such as /boot/initrd‑VERSION‑release.img (CentOS 5) or /boot/initramfs‑VERSION‑release.img (CentOS 6/7).
2. CentOS System Boot Process
Overall boot order: POST → BIOS (Boot Sequence) → MBR (Boot Loader) → Kernel (ramdisk) → rootfs → switch_root → /sbin/init → set runlevel → system init scripts → start/stop services → launch terminal.
Detailed steps:
POST (Power‑On Self Test) : BIOS on the motherboard checks hardware and initializes devices.
Boot Sequence : BIOS loads the first sector (MBR) of the boot disk.
MBR : Contains 446 bytes of bootloader code and a partition table; presents a menu for selecting OS or kernel.
GRUB (Grand Unified Bootloader) : A multi‑stage bootloader. Stage 1 resides in the MBR, stage 1.5 provides a minimal filesystem driver, and stage 2 (in /boot/grub/) offers the menu and loads the selected kernel and initramfs.
Kernel initialization : The kernel mounts the ramdisk, detects hardware, loads drivers, mounts the root filesystem read‑only, then starts /sbin/init.
/sbin/init : Reads /etc/inittab (CentOS 5) or systemd units (CentOS 7) to set the default runlevel, execute initialization scripts, and launch the appropriate services and terminals.
Runlevels : Levels 0–6 define system states (shutdown, single‑user, multi‑user text, multi‑user with GUI, reboot, etc.).
System initialization script ( /etc/rc.d/rc.sysinit): Sets hostname, welcome message, activates udev/SELinux, mounts filesystems from /etc/fstab, checks and remounts the root filesystem, sets the clock, applies kernel parameters, activates LVM, swap, loads extra drivers, and performs cleanup.
Service start/stop : Scripts in /etc/rc.d/rc read /etc/rc$runlevel.d/ directories; K* scripts stop services (lower numbers stop first), S* scripts start services (lower numbers start first).
Entering single‑user mode involves editing the GRUB entry, adding single (or 1) to the kernel line, and booting.
3. Boot Process Summary
Kernel level: POST → BIOS → MBR/GRUB (three stages) → Kernel (detect hardware, load drivers, mount root read‑only, hand over to /sbin/init). Modern CentOS 6/7 use initramfs instead of initrd to avoid double buffering.
User space level: /sbin/init reads configuration, sets the default runlevel, runs /etc/rc.d/rc.sysinit, stops/starts services according to the runlevel, and finally launches the login terminal (text or graphical).
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.
