🥾 The Boot Process
Simple Boot Steps 🥾
- BIOS/UEFI: Hardware initialization and boot device selection.
- GRUB: Loads the Linux kernel.
- Kernel: Initializes hardware and starts systemd.
- Systemd: Manages services and boot targets.
- File Systems: Root and other filesystems are mounted.
- Services: System services are started.
- Login Prompt: A login prompt (TTY or GUI) is displayed.
Boot Process 🥾
1. BIOS/UEFI Initialization
When the system is powered on, the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) initializes hardware components (e.g., CPU, memory, storage). The BIOS/UEFI checks for a valid bootable device (e.g., hard drive, USB) and reads the bootloader from the Master Boot Record (MBR) or GUID Partition Table (GPT).
2. Boot Loader (GRUB)
The GRUB (GRand Unified Bootloader) is the default bootloader in RHEL systems.
GRUB is responsible for loading and transferring control to the operating system kernel. It presents a boot menu where users can select the desired kernel or operating system.
It reads the configuration file located at /boot/grub2/grub.cfg
and can load additional modules, depending on the system setup.
3. Kernel Initialization
The selected Linux kernel is loaded into memory.
The kernel initializes the system's hardware (via device drivers) and mounts the root filesystem as read-only.
During this stage, initial RAM disk (initrd) or initramfs is used as a temporary root filesystem to prepare the actual root filesystem for mounting.
The kernel starts the first process, systemd
(PID 1).
4. Systemd Initialization
Systemd takes over as the init system (the first process), responsible for managing system services and booting the system to a usable state.
It reads unit files (configuration files) from /etc/systemd/system/
and /usr/lib/systemd/system/
.
Systemd executes the system's initialization targets, which are similar to run levels in earlier init systems. The default target is usually multi-user.target
(equivalent to runlevel 3) or graphical.target
(runlevel 5).
5. Mounting File Systems
During the boot process, file systems listed in /etc/fstab
are mounted, starting with the root filesystem.
Systemd ensures that all file systems and storage devices are properly mounted and available for use.
6. Starting Services
Systemd starts all the necessary system services (e.g., networking, logging, daemons). Services are controlled through systemd unit files, which specify how and when services should be started.
7. Login Prompt (Get TTY or GUI)
Once the system has reached the target (e.g., multi-user.target
or graphical.target
), a login prompt is presented to the user.
For multi-user.target (text mode), a getty service starts on virtual terminals, allowing users to log in.
For graphical.target (GUI mode), a display manager (e.g., GDM for GNOME) is started, and a graphical login screen is presented.