Unlocking Linux: How the Kernel and CentOS Boot Process Really Work
This article explains the components of the Linux kernel, the design philosophies behind it, and provides a step‑by‑step walkthrough of the CentOS boot sequence—from POST and BIOS to GRUB stages, kernel initialization, run‑level configuration, and final user‑space startup.
1. Linux Kernel Components
Related concepts: A Linux system consists of the kernel plus the root file system.
The kernel handles process management, memory management, network protocol stack, file system, and device drivers.
IPC (Inter‑Process Communication) enables processes to exchange information; Linux inherits Unix IPC mechanisms, including System V IPC, POSIX IPC, and socket‑based IPC.
The running system is divided into kernel space (kernel code and system calls) and user space (applications, processes, or threads).
Kernel design philosophies:
Monolithic kernel – all functions integrated into a single program (e.g., Linux).
Microkernel – each function implemented as a separate subsystem (e.g., Windows).
Linux kernel characteristics:
Supports modularity: .ko (kernel object) modules.
Modules can be loaded or unloaded dynamically at runtime.
Key files:
Core file: /boot/vmlinuz‑VERSION‑release Initramfs/Initrd images:
CentOS 5: /boot/initrd‑VERSION‑release.img CentOS 6/7:
/boot/initramfs‑VERSION‑release.img2. CentOS Boot Process
Overall boot order: POST → BIOS (Boot Sequence) → MBR (Boot Loader) → Kernel (ramdisk) → rootfs → switch_root → /sbin/init → run‑level setting → init scripts → service start/stop → terminal.
Detailed steps:
POST (Power‑On Self Test) : BIOS on the motherboard checks hardware and initializes devices.
Boot Sequence : The firmware selects the boot device and loads the MBR.
MBR (Master Boot Record) : First 512 bytes of the disk; the first 446 bytes contain the bootloader, the remaining bytes hold the partition table.
GRUB (Grand Unified Bootloader) : Loaded from the MBR; GRUB consists of three stages:
Stage 1 – stored in the MBR.
Stage 1.5 – located in the sectors immediately after the MBR; provides a minimal filesystem driver so Stage 2 can be accessed.
Stage 2 – resides in /boot/grub/, presents a menu and loads the selected kernel and initramfs.
Kernel initialization : The kernel mounts the initial ramdisk, detects hardware, loads drivers, mounts the root filesystem read‑only, and then executes /sbin/init.
/sbin/init : Reads /etc/inittab (CentOS 5/6) to determine the default run‑level, runs the appropriate init scripts, and starts or stops services for that level.
Run‑level configuration (0‑6):
0 – shutdown
1 – single‑user mode
2 – multi‑user without NFS
3 – multi‑user with text console
4 – reserved
5 – multi‑user with graphical interface
6 – reboot
System initialization scripts ( /etc/rc.d/rc.sysinit) perform tasks such as setting the hostname, activating SELinux, mounting filesystems, loading kernel parameters, activating LVM/RAID, enabling swap, and loading additional drivers.
Service start/stop per run‑level : Scripts in /etc/rc$LEVEL.d/ with prefixes K (stop) and S (start) are executed in order of their numeric priority.
Terminal launch : After services are ready, the appropriate login terminal (text or graphical) is started.
GRUB configuration file ( /boot/grub/grub.conf or /etc/grub.conf) defines menu entries and kernel parameters; editing it and adding single or 1 to the kernel line allows booting into single‑user mode.
3. Summary
The Linux boot process starts with hardware self‑test, proceeds through BIOS, MBR, and the three‑stage GRUB loader, then loads the kernel and initramfs, mounts the root filesystem, and finally hands control to /sbin/init, which configures the run‑level, runs initialization scripts, manages services, and starts the user terminal.
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.
