Describe the Linux boot process from BIOS to init.
Answer
The boot sequence: 1. BIOS/UEFI — firmware runs POST (power-on self test), detects hardware, and loads the bootloader from the boot device. 2. GRUB2 — the bootloader presents a menu (or boots immediately), loads the kernel image (vmlinuz) and the initial RAM disk (initrd/initramfs) into memory. 3. Kernel initialization — the kernel decompresses itself, initializes hardware subsystems (memory, interrupts, I/O), mounts the initramfs as a temporary root filesystem, and runs the early userspace tools to locate and mount the real root filesystem. 4. Real root filesystem mounted — the kernel pivots to the real root and executes /sbin/init (PID 1). 5. systemd (init) — PID 1 reads unit files, resolves dependencies, and starts all enabled services in parallel according to the target (e.g., multi-user.target or graphical.target). Understanding this sequence is essential for diagnosing boot failures and configuring custom boot parameters.
Previous
How do you use perf and flame graphs for performance analysis on Linux?
Next
How does file descriptor management work in Linux (0/1/2, /dev/null, redirection internals)?
More Linux / Shell Scripting Questions
View all →- Advanced What are Linux namespaces and cgroups, and how do they underpin containers?
- Advanced How do iptables and nftables handle packet filtering rules?
- Advanced What is LVM (Logical Volume Manager) and what problems does it solve?
- Advanced How does /etc/fstab work and what are important mount options?
- Advanced How do sysctl kernel parameters work and what are important tuning examples?