r/archlinux • u/as_uu_00 • 1d ago
QUESTION Help understanding the Linux boot process vs. Arch Linux boot setup?
I’m trying to deeply understand the Linux boot process, but every article and video I find stays pretty superficial.
They usually just say: Press Power Button → POST executes → UEFI loads GRUB → GRUB loads vmlinuz and initramfs
Where I get confused is how this connects to what we actually do during an Arch Linux installation (setting up the EFI System Partition, using efibootmgr, configuring grub.cfg, EFI Shell, etc.).
Can someone explain the low-level, step-by-step connection between what the hardware/firmware does at power-on and what tools like GRUB, efibootmgr, and initramfs are actually doing behind the scenes?
0
Upvotes
1
8
u/CaviarCBR1K 22h ago
So I'm no expert, but I'll try to explain it to the best of my knowledge.
When you press the power button, the motherboard firmware performs the POST, then initializes UEFI firmware. The UEFI firmware looks at the motherboards NVRAM (non-volatile RAM) for boot entries. This is where
efibootmgrcomes in.efibootmgris just a tool that writes boot entries to NVRAM for your UEFI firmware to find. GRUB usesefibootmgrto do this automatically, but you can also add/remove boot entries manually.Once the firmware finds your bootloader's entry (in this example, GRUB), then it will initialize it and temporarily mount the EFI partition where your boot files will be stored. You can think of the EFI partition kind of like a filing cabinet that organizes and holds the instructions and necessary files for booting an operating system. After you select the OS you want to boot into (Arch Linux in this example), then GRUB will retrieve the boot files, load them into memory and start the boot process. This is where the handover happens. At this point, the CPU leaves the UEFI environment and hands instruction over to the kernel.
vmlinuzis the compressed kernel image, but it can't do anything without a filesystem. That's where the initramfs comes in. It's just a small, temporary filesystem thatvmlinuzuses to actually boot. Inside initramfs, the kernel decompresses itself and takes full control of the hardware. It finds and mounts your root drive, sets up some critical hardware drivers (like CPU, RAM, etc.), and then initializes PID 1, otherwise known as the 'init system.'On Arch Linux, the init is SystemD, but other distros may use other init systems like Runit, OpenRC, SysVInit and many others. The init system is responsible for the rest of the boot process. It reads configuration files, mounts any remaining drives, loads necessary kernel modules, starts networking stack and any other daemons/background tasks.
And that's it. Once the init system runs it's tasks, you should be fully booted and ready to log in. Hopefully that gives you a better idea of the boot process.