Boot Process

How firmware, bootloaders, kernels, and user space start an operating system, with Linux/x86 BIOS/MBR and UEFI paths plus practical troubleshooting.

published: reading time: 26 min read author: Geek Workbench
Quick Summary

How firmware, bootloaders, kernels, and user space start an operating system, with Linux/x86 BIOS/MBR and UEFI paths plus practical troubleshooting.

Boot Process

Booting turns a powered-on device into a usable operating system, but the exact path depends on its platform and configuration.

Introduction

There is no universal boot path. Firmware, architecture, boot source, operating system, and security policy all affect which components run and in what order. A phone, an x86 PC, a virtual machine, and a network-booted server can follow different sequences; some combine stages or boot a kernel directly. This article first describes the stages most systems have in common, then follows one detailed example: Linux on x86, with legacy BIOS/MBR and UEFI paths called out separately.

These distinctions help narrow down where a failure occurs and which recovery tools apply. The Linux examples below are distribution-dependent; follow the documentation for the installed system before changing firmware entries, bootloader files, or kernel parameters.

Common Conceptual Stages

Treat these as stages in a mental model, not a promise that every system uses each one as a separate component:

  1. Reset and platform initialization: The processor begins from a platform-defined reset state. Firmware or a boot ROM initializes enough hardware to continue. Desktop firmware commonly performs POST checks, but the exact checks and messages vary.
  2. Boot-source selection: Platform policy chooses a local disk, removable media, network source, or another boot target. Firmware settings, boot order, and security policy can affect the choice.
  3. Load the next executable: Firmware may start a boot manager, an OS loader, a bootloader, or a kernel directly. There is not always a separate bootloader.
  4. Load the operating system image and inputs: The selected loader makes the kernel and any initramfs, device tree, or command-line options available. Some systems package several of these into one image.
  5. Discover the root environment: The kernel starts early userspace when one is provided. It may load storage drivers, unlock encryption, assemble storage layers, find the real root filesystem, or continue running from the initramfs.
  6. Start the regular user space: The chosen first userspace process (PID 1 on Linux) starts services and eventually presents a console, login manager, or application interface.

A failure can occur between any two stages, and not every stage leaves an operating-system log. The troubleshooting flow below starts with the earliest evidence available.

Detailed Example: Linux on x86

This example uses Linux on x86; distributions can use GRUB, systemd-boot, an EFI stub, a unified kernel image, or another loader. The firmware boot mode and disk partition layout are separate choices, so identify both before repairing a boot installation.

Legacy BIOS with an MBR boot disk

In legacy BIOS mode, firmware initializes the machine, selects a device, and begins executing boot code from it. In a common GRUB-on-MBR installation, a small first stage in the disk’s boot sector loads the rest of GRUB from its installed location; GRUB then loads the Linux kernel and optional initramfs.

MBR is a partition-table format, not a limit on the BIOS processor mode. Its traditional 32-bit sector addressing limits a disk using 512-byte logical sectors to about 2 TiB and allows four primary partition entries. These are MBR layout constraints; other boot arrangements and sector sizes change the practical limits. The GRUB installation target and repair steps depend on the distribution and the selected BIOS boot layout.

UEFI boot (UEFI Specification 2.10)

UEFI firmware uses a boot manager. The UEFI 2.10 Boot Manager reads the NVRAM BootOrder list and its referenced Boot#### entries; each entry identifies a device and an EFI executable to load. A typical Linux installation places that executable on an EFI System Partition (ESP), often on a GPT disk. UEFI 2.10 also describes device paths for both GPT and legacy MBR media, so firmware interface and partition-table format should not be treated as synonyms. See the UEFI Specification 2.10 Boot Manager.

Secure Boot is an optional UEFI policy that authenticates EFI images against enrolled keys. The exact Linux chain—such as firmware, shim, GRUB, kernel, and modules—depends on the distribution and enrolled keys; see Secure Boot below. The GNU GRUB Manual 2.14 documents GRUB’s BIOS and EFI targets and configuration behavior.

A UEFI system can also launch a Linux kernel through its EFI stub without a conventional GRUB-style loader. The Linux EFI stub documentation describes that path. Some systemd-based setups use a unified kernel image (UKI) that packages a kernel, initrd, and related metadata; systemd’s root file system discovery guide explains its recommended UEFI arrangement and notes that distributions differ.

Linux kernel and early-userspace handoff

After the loader starts Linux, the kernel processes its boot parameters and initializes hardware and core subsystems. If an initramfs is present, its early-userspace program prepares the root environment—for example by loading storage drivers, unlocking LUKS, activating LVM or RAID, and locating the root filesystem. The initramfs then hands control to the regular root environment. With systemd, PID 1 starts units according to their dependencies; other Linux systems use a different init system.

Not every UEFI Linux boot needs GRUB, and not every Linux boot needs a separate root filesystem after initramfs. The boot mode and image layout determine which steps apply.

Linux Boot Troubleshooting: Symptom → Evidence → Next Step

If firmware cannot start an operating system, Linux logs may not exist for that attempt. Start with firmware setup or external recovery media. Once Linux or its initramfs has started, use the evidence for that stage:

Symptom Log or source to inspect Next step
Firmware reports “no bootable device” or starts the wrong entry Firmware boot menu and boot-mode setting; on a running UEFI Linux system, efibootmgr -v shows boot entries. Inspect the referenced EFI file on the ESP. Confirm the installation’s UEFI or legacy mode, boot order, and target file. For BIOS/MBR, confirm the intended disk is selected. Repair with the distribution’s instructions for that exact layout.
GRUB rescue prompt or expected kernel missing from its menu GRUB’s on-screen error; from a live system inspect lsblk -f, mount points, the distribution’s grub.cfg path (often /boot/grub/grub.cfg or /boot/grub2/grub.cfg), and available kernel/initramfs files. Check that the right root, /boot, and ESP are mounted and that the GRUB entry points to existing files. Regenerate configuration with the distribution’s tool; avoid copying a generic grub-install command across BIOS and UEFI layouts.
Initramfs shell cannot find or mount the root filesystem The initramfs console and kernel command line (/proc/cmdline); compare root= with lsblk -f. On dracut systems, inspect /run/initramfs/rdsosreport.txt. Verify the root UUID and include required controller, filesystem, encryption, LVM, or RAID support in the initramfs. The systemd root file system discovery guide describes root= handling for systemd-based initrds.
Kernel panic before the login prompt Capture the console trace. If the failed boot was recorded in the persistent journal, inspect journalctl -k -b -1; otherwise try a previous kernel from the boot menu. Compare the failing kernel’s command line, modules, and initramfs with the last working entry. Use the panic trace to identify the failing driver or root-mount stage.
System reaches rescue/emergency mode or a required service fails On the affected Linux boot, inspect systemctl --failed, journalctl -b -p err, and systemd-analyze critical-chain. Fix the specific failed mount or service dependency. Use the rescue or emergency target as needed, then reboot and confirm the normal target completes.

Trade-off Table

Linux/x86 boot path Firmware handoff Common disk layout Security notes
Legacy BIOS with GRUB Executes boot code from the selected device Often MBR; its limits come from the partition format and sector size Does not provide UEFI Secure Boot; other protections depend on platform and loader
UEFI 2.10 with GRUB or another EFI loader Boot Manager loads an EFI executable selected by NVRAM boot policy Commonly GPT plus an ESP; UEFI device paths can also describe MBR media Secure Boot is optional and depends on enrolled keys and the software chain
UEFI direct kernel / UKI Firmware loads a kernel EFI stub or unified kernel image Commonly ESP, with layout depending on the distribution Authentication depends on Secure Boot policy and image contents
Network boot (PXE/iPXE) Firmware or a loader obtains the next image from the network No local boot disk required BIOS and UEFI implementations differ; use the matching image and policy
Init System Parallel Startup Resource Usage Complexity Legacy Support
SysV init No Minimal Low Excellent
systemd Yes Higher High Good
OpenRC Partial Moderate Medium Good
runit Yes Minimal Low Limited

Implementation Snippets

Viewing Boot Messages (Linux)

#!/bin/bash
# Analyze recent boot messages

echo "=== Kernel Messages from Current Boot ==="
dmesg | head -50

echo -e "\n=== Boot Time Errors ==="
dmesg | grep -iE "error|failed|warning" | tail -20

echo -e "\n=== systemd Boot Analysis ==="
systemd-analyze time
systemd-analyze blame | head -20

echo -e "\n=== Failed Services ==="
systemctl --failed --no-pager

GRUB Configuration Analysis

#!/bin/bash
# Inspect current GRUB configuration; adjust the config path for your distribution.

echo "=== GRUB Default Boot Entry ==="
grep "^menuentry" /boot/grub/grub.cfg | head -5

echo -e "\n=== Kernel Command Line Parameters ==="
grep "linux" /boot/grub/grub.cfg | head -3

echo -e "\n=== Bootloader Version ==="
grub-install --version 2>/dev/null || echo "GRUB version check not available"

Analyzing Boot Process Timing

#!/bin/bash
# Detailed boot performance analysis

echo "=== systemd-analyze critical-chain ==="
systemd-analyze critical-chain

echo -e "\n=== Top 10 Slowest Services ==="
systemd-analyze blame | head -10

echo -e "\n=== Kernel Boot Timing ==="
cat /proc/stat | grep btime
uptime --since

UEFI Boot Order Configuration

#!/bin/bash
# Run on Linux booted in UEFI mode; the ESP mount point varies by distribution.

echo "=== Current Boot Order ==="
efibootmgr -v

echo -e "\n=== EFI Boot Entries ==="
ls -la /boot/efi/EFI/

echo -e "\n=== Secure Boot Status ==="
mokutil --sb-state 2>/dev/null || echo "mokutil not available"

Observability Checklist

Boot-Time Monitoring

# Record boot timing for analysis
systemd-analyze dot > boot-graph.dot

# Save the previous systemd journal when persistent boot logs are enabled
journalctl -b -1 > previous-boot.log 2>&1

# Capture kernel parameters used
cat /proc/cmdline

# Check filesystem mount order
mount | grep -E "^/dev"

Boot Failure Debugging

# Boot with debug shell
# Add to kernel parameters: init=/bin/bash

# For systemd debug
# Add: systemd.log_level=debug

# Early console options are kernel/platform-specific; this is a legacy x86 example
# Add a supported earlyprintk/earlycon setting for the installed kernel

# Network-based debugging (for embedded)
# Add: netconsole=[port]@[dev],[dev]

Common Pitfalls / Anti-Patterns

Secure Boot Pitfalls

UEFI Secure Boot is a firmware policy that authenticates EFI images against enrolled keys before execution. On Linux, later checks—such as shim, GRUB, kernel, and module signature enforcement—depend on the distribution and configuration; firmware verification alone does not guarantee that every later component or module is checked. See the UEFI Specification 2.10 Boot Manager. Secure Boot commonly causes issues when:

  • Third-party drivers are blocked — Linux distributions may enforce kernel-module signatures when Secure Boot is enabled. If the distribution uses shim and MOK, follow its documented process to sign a module and enroll a key; do not assume mokutil --import applies to every UEFI setup.
  • Custom kernels are rejected — a distribution’s signed boot chain may accept its own kernel but reject custom images; use that distribution’s signing and key-enrollment procedure.
# Linux distribution with shim/MOK support: inspect Secure Boot state
mokutil --sb-state

# Only where the distribution documents MOK enrollment:
mokutil --import /path/to/sign.der

Measured Boot Considerations

Measured boot uses a TPM to record measurements of selected boot events. Firmware or later components extend measurements into platform configuration registers (PCRs), with the hash algorithm determined by the PCR bank. Which events are measured and which PCRs they use depend on the platform and its event-log profile; inspect the event log instead of assuming a fixed PCR map.

A verifier can examine a TPM quote and its event log against an expected policy. This provides evidence about what ran, but it does not itself block unauthorized code. Secure Boot and measured boot serve different roles: one applies an execution policy, while the other records measurements for later verification.

Full Disk Encryption Interaction

Disk encryption adds an early boot step, but the workflow is operating-system-specific:

  • Linux with LUKS: early userspace in the initramfs must unlock the volume before mounting the root filesystem. Distribution tools such as dracut or initramfs-tools provide the required hooks.
  • Windows with BitLocker: firmware measurements and TPM policy can participate in releasing the volume key; recovery behavior follows Windows and device policy.

If the encrypted root cannot be unlocked, inspect the initramfs or platform recovery prompt and follow the distribution’s or OS vendor’s recovery procedure.

Common GRUB and Boot Parameter Mistakes

Commands and paths vary by distribution. Use the installed distribution’s bootloader and initramfs documentation.

  1. Editing generated GRUB configuration — Editing grub.cfg directly is usually overwritten when the distribution regenerates it. Change the documented configuration source and run that distribution’s generator.

  2. Kernel parameter typos — A single character error can prevent booting. Verify changed parameters in the bootloader menu before making them permanent.

  3. Initramfs not regenerated after kernel updates — New kernel modules or drivers may require rebuilding the initramfs with the distribution’s tool, such as dracut or update-initramfs.

  4. UEFI boot entries pointing to deleted files — Removing an EFI file can leave an NVRAM entry pointing to a missing path. Verify the entry and its target before removing an entry with a tool such as efibootmgr.

  5. Disk order changes after a drive swap — Device names such as /dev/sda can change. Use stable identifiers such as filesystem UUIDs where the configuration supports them.

Quick Recap Checklist

  • Common conceptual stages: platform initialization → boot-source selection → load executable → kernel/early userspace → regular user space; platforms may merge or omit stages
  • Legacy BIOS and UEFI are firmware paths; MBR and GPT are partition-table formats, not firmware modes
  • Linux loaders such as GRUB commonly load a kernel and optional initramfs, but EFI stubs and unified kernel images can combine or omit components
  • The Linux kernel initializes core subsystems: memory, interrupts, scheduling, and VFS
  • PID 1 starts user-space services according to the selected init system
  • Match recovery steps to the boot mode, disk layout, and distribution
  • Use console, initramfs, and system logs that correspond to the failed stage
  • UEFI Secure Boot authenticates EFI images under enrolled-key policy; later Linux checks vary by distribution
  • Full-disk encryption often depends on early-userspace support
  • Measure Linux user-space boot timing with systemd-analyze

Interview Questions

1. What is the difference between BIOS and UEFI?

Legacy BIOS is an older PC firmware interface that starts boot code from a selected device. BIOS boot is often paired with an MBR partition table, but firmware mode and partition format are distinct choices. Traditional MBR uses 32-bit sector addresses; with 512-byte logical sectors it reaches about 2 TiB and provides four primary partition entries. Those are MBR limits, not an inherent BIOS processor-mode limit.

UEFI 2.10 provides a firmware Boot Manager that selects EFI images through NVRAM boot entries such as BootOrder and Boot####. A typical Linux installation stores an EFI executable on an EFI System Partition, commonly alongside a GPT layout. UEFI also defines device paths for legacy MBR media, so UEFI and GPT are not synonyms. Secure Boot is an optional policy based on enrolled keys, not a guarantee that every later Linux component is checked.

Some UEFI firmware offers a Compatibility Support Module (CSM) for legacy boot. Whether it is available and how it behaves depends on the platform. For recovery, confirm which mode the installed operating system uses before changing firmware settings.

2. What is the purpose of the bootloader?

A bootloader is one common bridge between firmware and the operating system kernel. Depending on the platform, firmware may instead load an OS loader, EFI stub, or kernel image directly. A conventional Linux bootloader can provide these functions:

  • Locates the kernel on the storage device
  • Loads the kernel and optional initial ramdisk (initramfs) into memory
  • Understands filesystem structure to find files
  • Presents boot options (multiple kernels, recovery modes)
  • Passes configuration parameters to the kernel

GRUB 2 is a common Linux bootloader, with separate BIOS and EFI targets; other Linux configurations use systemd-boot, a kernel EFI stub, a unified kernel image, or another loader. See the GNU GRUB Manual 2.14 for GRUB-specific behavior.

3. What is initramfs and why is it needed?

An initramfs is an early-userspace image (commonly a cpio archive) made available to Linux with the kernel by a bootloader or EFI stub. It contains programs and drivers used to prepare the root environment before the regular system starts.

The problem it solves: the kernel needs a root filesystem to mount, but if the root filesystem requires special drivers (LUKS encryption, LVM, RAID, specific SATA controllers), those drivers might be on the root filesystem itself—a chicken-and-egg problem.

initramfs breaks this cycle by containing the necessary drivers to unlock encrypted volumes, assemble RAID arrays, activate LVM logical volumes, and mount the real root filesystem. Once mounted, the system "pivots root" from initramfs to the real filesystem and continues booting.

4. What happens when the kernel hands off to systemd?

When the kernel finishes early initialization, it looks for the first userspace process to run—the first program that isn't part of the kernel. On systemd systems, the kernel executes systemd as PID 1 (the first user-space process).

systemd then begins its job of starting the system: it reads its configuration files (unit files), analyzes dependencies between services, and starts services in the correct order. Unlike old SysV init with sequential startup, systemd starts many services in parallel where dependencies allow, significantly speeding up boot time.

systemd doesn't just start services—it owns the entire user-space environment: it manages mounting filesystems (including /proc, /sys, /dev), configures hostname and locale, sets up D-Bus for inter-process communication, and eventually starts the login prompt or graphical display manager.

5. How does Secure Boot work and what are its implications?

UEFI Secure Boot applies firmware policy to the EFI images it loads, checking signatures against enrolled keys and revocation data. The UEFI 2.10 Boot Manager specification describes this firmware behavior. What happens after the first EFI image depends on the Linux distribution: a signed shim may validate GRUB or a kernel, and the running kernel may enforce module signatures.

Distribution-provided kernels often work with their documented Secure Boot chain. Custom kernels and third-party modules may require signing and key enrollment through distribution-specific tools such as shim's MOK workflow. Check that workflow before changing keys or disabling Secure Boot; a compromised trusted key or an unverified later stage can undermine the intended protection.

6. What happens during the Linux kernel decompression phase?

Most production Linux kernels are compressed (gzip, LZMA, or zstd) to reduce size. After GRUB loads the kernel into memory, the kernel header specifies the decompression entry point. The decompressor runs in real mode initially, sets up a minimal page table, decompresses the kernel into its final location in memory, then jumps to the kernel's actual entry point.

During decompression, the kernel relocates itself (if needed), parses boot parameters from the command line, and prepares the early pagetable. If the kernel was built with CONFIG_RANDOMIZE_BASE, ASLR is applied even at this early stage. The decompression console output ("Loading Linux kernel...") is often visible during boot.

7. How does GRUB 2 locate and load the initramfs archive?

GRUB 2 locates initramfs via the initrd kernel parameter specified in GRUB config (/boot/grub/grub.cfg). GRUB reads the initramfs cpio archive into memory and passes the memory address and size to the kernel via the boot parameters. The kernel stores this address and uses it during the early userspace handoff.

Modern kernels also support initramfs as an embedded cpio archive compiled into the kernel image (via CONFIG_INITRAMFS_SOURCE). In this case, no external file is needed—the initramfs is part of the kernel image itself.

8. What is the "pivot_root" mechanism and how does initramfs use it?

When an initramfs is used, its /init program prepares storage, locates and mounts the regular root filesystem, then hands off to it. The handoff is userspace- and distribution-specific; tools such as switch_root or pivot_root may be used. Some systems keep running from the initramfs instead of switching to another root.

This early-userspace stage solves the chicken-and-egg problem: the root filesystem may need drivers or setup for LUKS, LVM, RAID, or a network source that is not available until the initramfs runs.

9. What is UEFI Runtime Services and how does it persist across the kernel boot?

UEFI Runtime Services are a set of services provided by the firmware that persist even after an OS boots—_GetVariable(), SetVariable(), QueryVariableInfo(), etc. They allow the OS to read/write UEFI variables stored in NVRAM (like boot order, Secure Boot keys, and platform diagnostics). The kernel maps these services into a known virtual address via SetVirtualAddressMap().

After the kernel takes over, these services are still callable from kernel context via the efivarfs filesystem (mounted at /sys/firmware/efi/efivars). This is how tools like efibootmgr and mokutil modify boot settings—via efivarfs which wraps the UEFI runtime service calls.

10. How does measured boot (TPM-based) establish chain of trust?

Measured boot uses a TPM to record cryptographic measurements of selected boot events. Firmware or later components extend measurements into platform configuration registers (PCRs); the extension uses the hash algorithm for that PCR bank. The measured components and PCR assignments depend on the platform and its event-log profile, so do not assume one fixed PCR map or a single hash algorithm.

A verifier can examine a TPM quote and the associated event log to compare the recorded boot measurements with an expected policy. This provides evidence about what ran, but it does not itself block unauthorized code; Secure Boot and measured boot serve different roles.

11. What is the difference between systemd.unit=rescue.target and systemd.unit=emergency.target?

emergency.target starts a minimal shell on the main console as soon as possible—it mounts the root filesystem read-only and starts minimal debugging. No other services run. It's the most minimal rescue mode.

rescue.target is more complete: it mounts the root filesystem read-write, starts system logger, configures the hostname and locale, and brings up the network. It then runs a shell on tty1. rescue.target is appropriate when you need the filesystem mounted and some services running to troubleshoot—but without the normal multi-user service stack.

12. What is dracut and how does it relate to initramfs?

dracut is the tool that builds the initramfs image on Red Hat-based systems (Fedora, RHEL, CentOS). It analyzes the kernel modules and dependencies needed to boot the system, includes those modules in a cpio archive, and adds the shell scripts for the boot process. Unlike older mkinitrd, dracut is hardware-agnostic and generates a minimal-but-complete initramfs.

The relationship: dracut produces the initramfs; the initramfs uses dracut-generated scripts to locate the real root, load necessary drivers (LUKS, LVM, network), and hand off to the real root filesystem. Regenerating initramfs (dracut -f) is necessary after kernel updates or driver changes.

13. How does Secure Boot prevent a rootkit from loading before the OS?

UEFI Secure Boot authenticates EFI images under the firmware's enrolled-key and revocation policy. On Linux, later validation depends on the distribution's chain—for example, shim may validate GRUB or a kernel, and the kernel may enforce module signatures.

This can prevent an unauthorized EFI image from running when its signature is rejected, but it does not protect against every threat: compromised keys, policy changes, and unverified later stages can weaken the chain. Keep the exact distribution and firmware trust configuration in the recovery runbook.

14. What is the role of the EFI System Partition (ESP) and what filesystems does it use?

The EFI System Partition is a firmware-readable system partition, commonly formatted with FAT. On GPT disks it uses the EFI System Partition type GUID (C12A7328-F81F-11D2-BA4B-00A0C93EC93B); legacy MBR layouts use a different partition type. UEFI boot managers load EFI files from the ESP and keep boot entries in firmware NVRAM, not on the ESP itself.

Linux distributions commonly store their EFI loader files below /EFI/vendor/ or another vendor-specific directory. The exact mount point and directory layout depend on the installation.

15. What is the "init" process and why does PID 1 matter?

PID 1 is the first user-space process the kernel starts after initialization. In traditional SysV init, this is the init binary. In systemd, it's the systemd binary. PID 1 is special because it inherits orphaned processes (if a parent dies, its children are reparented to PID 1) and receives signals that would otherwise kill the system (e.g., SIGTERM for graceful shutdown).

The kernel waits for PID 1 to exec the specified userspace program before considered "booted." If PID 1 dies, the kernel panics (cannot proceed without an init process). PID 1 also manages service lifecycle, mount propagation (shared mounts become slave), and is the ancestor of all subsequent processes.

16. How does systemd-analyze blame help identify boot bottlenecks?

systemd-analyze blame prints a list of units sorted by how long they took to activate during the most recent boot. This reveals which services are the slowest to start. For example, if network-online.target takes 8 seconds, you know the network configuration or DHCP is slow. The output shows the accumulated time spent in each unit's activation.

Use it with systemd-analyze critical-chain to see the critical path (the longest chain of dependent units)—optimizing units on the critical path has the most impact on total boot time.

17. What happens when a kernel module is loaded at boot time vs. after the system is fully booted?

Loading at boot time (via /etc/modules or module configuration in initramfs): modules load during the initramfs phase or early boot, before the filesystem is fully available. This is necessary for modules required to mount the root filesystem (storage controllers, filesystem drivers, encryption). The order is critical.

Loading after boot (via modprobe or insmod): the system is fully operational, so module dependencies can be resolved from /lib/modules/$(uname -r)/modules.dep, and user-space is available for error handling. modprobe also handles module arguments via /etc/modprobe.d/ configuration files.

18. What is the role of /run and how does it differ from /var in early boot?

/run is a tmpfs filesystem mounted early in boot (by systemd or init scripts) to hold runtime data that does not need to persist across boots—PID files, socket files, transient application state. It replaces the older /var/run symlink and /var/lock symlink patterns.

The key difference: /var may reside on the persistent root filesystem, which may not be mounted yet during early boot. /run is a RAM-based tmpfs, so it is available immediately after the early boot mount manager starts. Services needing runtime files during early boot use /run, not /var.

19. Why might a system fail to boot with "unable to open initial console" and how is it resolved?

This error occurs when the kernel's early userspace (/init or the shell from initramfs) cannot open /dev/console for standard input. The kernel passes console= boot parameters to set the console device, but if that device node doesn't exist in initramfs, the open fails.

Resolution: rebuild initramfs with the correct device nodes (udev or mdev populates /dev), or pass a console= device that exists in the initramfs. In dracut-based systems, dracut --force --add udev ensures udev runs early enough to create /dev/console.

20. What is the relationship between GRUB, initramfs, and the Linux kernel in a network boot (PXE) scenario?

In PXE boot, the firmware broadcasts a DHCP request with PXE options. The DHCP server returns boot server address and filename (the bootloader). The firmware downloads the bootloader via TFTP and executes it. GRUB (compiled as a PXE GRUB binary) then uses its own config or a network path to locate the kernel and initramfs via TFTP/HTTP, passes kernel parameters (including ip=dhcp), and boots.

The initramfs must include network drivers to bring up the network after boot. The PXE boot flow bypasses local storage entirely—the entire boot chain (bootloader, kernel, initramfs) comes from the network. This is standard in diskless workstations, cloud instances (where metadata comes via DHCP/PXE), and enterprise provisioning systems.

Further Reading

Conclusion

A boot path takes an operating system from platform initialization to a usable user space. The components and handoffs vary, but identifying the stage that failed helps narrow the relevant recovery tools and security checks.

When Linux fails to start, check the firmware mode, partition layout, distribution, and loader before changing the boot chain. Those details determine which Secure Boot policy and recovery steps apply.

Next, study kernel initialization, systemd unit files, or early-userspace debugging. Each covers a stage after the handoffs described here.

Category

Related Posts

ASLR & Stack Protection

Explore ASLR, PIE, stack canaries, and NX on Linux with GCC, then inspect a harmless C program to see what each mitigation does and where it falls short.

#operating-systems #aslr-stack-protection #computer-science

Assembly Language Basics: Writing Code the CPU Understands

Learn x86-64 Linux assembly with the System V ABI: track registers, assemble and run a small program, debug it in GDB, then compare AArch64.

#operating-systems #assembly-language-basics #computer-science

Boolean Logic & Gates

Understanding AND, OR, NOT gates and how they combine into arithmetic logic units — the building blocks of every processor.

#operating-systems #boolean-logic-gates #computer-science