# Linux - Boot Architecture

# IEN-001 - Understanding the Linux Boot Process: From Power-On to User Space

# Introduction

Imagine arriving at the office on a Monday morning and discovering that one of your production Linux servers refuses to boot.

Instead of presenting a login prompt, the system stops with one of the following messages:

```
GRUB Loading...
Error 15: File not found
```

<div class="relative w-full mt-4 mb-1" id="bkmrk-"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--1"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Kernel panic - not syncing:
VFS: Unable to mount root fs on unknown-block(0,0)
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--2"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--3"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
dracut-initqueue timeout
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--4"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--5"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or perhaps it simply remains at a blinking cursor without displaying any error message.

Although these symptoms appear unrelated, they all originate from different stages of the Linux boot process.

This is one of the most common mistakes made by junior Linux administrators. They treat every boot problem as an isolated issue and immediately search for a command that promises to fix it. As a result, they often reinstall GRUB when the real problem is a missing initramfs, rebuild initramfs when the actual issue lies in an inactive LVM volume, or run filesystem repair tools against disks that are perfectly healthy.

Experienced infrastructure engineers take a different approach.

Rather than asking **"How do I fix this error?"**, they ask **"At which stage of the boot process did the system fail?"**

Once that question is answered, the number of possible root causes becomes dramatically smaller.

Understanding the Linux boot process is therefore not just an academic exercise. It is one of the most valuable troubleshooting skills an engineer can develop. Whether the server is a physical machine, a virtual machine running on VMware, a cloud instance, or a container host, every Linux system follows the same fundamental startup sequence before it becomes operational.

Throughout this article, we will follow that sequence step by step—from the moment electrical power reaches the motherboard until the operating system launches its first user-space process. More importantly, we will explain not only **what** happens during each stage, but also **why** it happens, how to verify it, and what kinds of failures are commonly associated with it.

This article serves as the foundation for the Linux series in **Infrastructure Engineering Notes**. Future articles covering GRUB recovery, initramfs reconstruction, LVM activation, kernel panic analysis, and disaster recovery will all build upon the concepts introduced here.

---

# Learning Objectives

After reading this article, you should be able to:

- Describe the complete Linux boot sequence from power-on to login.
- Explain the role of firmware, the bootloader, the kernel, and the initramfs.
- Understand how Linux discovers storage devices and mounts the root filesystem.
- Recognize where common boot failures occur.
- Identify which component is responsible for each stage of the startup process.
- Troubleshoot boot failures using a structured, stage-based approach instead of trial and error.

---

# The Linux Boot Process at a Glance

Although the Linux boot process involves hundreds of individual operations, it can be simplified into eight major stages.

```
                 +----------------------+
                 |   Power Button       |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | Firmware (BIOS/UEFI) |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 |   Hardware POST      |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 |   Bootloader (GRUB)  |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 |   Linux Kernel       |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | initrd / initramfs   |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | Root Filesystem Mount|
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | PID 1 (init/systemd) |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | System Services      |
                 +----------+-----------+
                            |
                            v
                 +----------------------+
                 | Login Prompt / GUI   |
                 +----------------------+
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--8"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--9"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Each stage depends entirely on the successful completion of the previous one.

If the firmware cannot detect the boot disk, the bootloader will never execute.

If the bootloader cannot load the Linux kernel, the operating system never starts.

If the kernel cannot access the initramfs, it may not have the drivers required to locate the root filesystem.

If the root filesystem cannot be mounted, userspace never begins.

If PID 1 cannot start, the system has no process responsible for launching services.

In other words, Linux does not "boot all at once." It progresses through a chain of dependent stages, where every stage assumes that the previous stage completed successfully.

This dependency chain is one of the most important concepts to remember throughout this article.

---

# Why Understanding the Boot Process Matters

Many engineers become familiar with Linux through daily operational tasks such as managing services, configuring networks, or deploying applications. As long as the server reaches a login prompt, there is little need to think about what happened beforehand.

The situation changes immediately when the system fails to boot.

At that point, understanding the startup sequence becomes essential.

Consider the following examples:

<div class="TyagGW_tableContainer" id="bkmrk-error-message-actual"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="7244" data-start="6909"><thead data-end="6949" data-start="6909"><tr data-end="6949" data-start="6909"><th class="last:pe-10" data-col-size="sm" data-end="6925" data-start="6909">Error Message</th><th class="last:pe-10" data-col-size="sm" data-end="6949" data-start="6925">Actual Problem Stage</th></tr></thead><tbody data-end="7244" data-start="6991"><tr data-end="7026" data-start="6991"><td data-col-size="sm" data-end="7014" data-start="6991">No Boot Device Found</td><td data-col-size="sm" data-end="7026" data-start="7014">Firmware</td></tr><tr data-end="7062" data-start="7027"><td data-col-size="sm" data-end="7048" data-start="7027">GRUB Rescue Prompt</td><td data-col-size="sm" data-end="7062" data-start="7048">Bootloader</td></tr><tr data-end="7088" data-start="7063"><td data-col-size="sm" data-end="7078" data-start="7063">Kernel Panic</td><td data-col-size="sm" data-end="7088" data-start="7078">Kernel</td></tr><tr data-end="7146" data-start="7089"><td data-col-size="sm" data-end="7123" data-start="7089">Unable to Mount Root Filesystem</td><td data-col-size="sm" data-end="7146" data-start="7123">initramfs / Storage</td></tr><tr data-end="7190" data-start="7147"><td data-col-size="sm" data-end="7172" data-start="7147">Volume Group Not Found</td><td data-col-size="sm" data-end="7190" data-start="7172">LVM Activation</td></tr><tr data-end="7244" data-start="7191"><td data-col-size="sm" data-end="7216" data-start="7191">`/sbin/init` not found</td><td data-col-size="sm" data-end="7244" data-start="7216">Userspace Initialization</td></tr></tbody></table>

</div></div>Notice that each error belongs to a different stage of the boot process.

Without understanding the startup sequence, every failure looks similar: "the server won't boot."

With a proper understanding of the boot sequence, the troubleshooting process changes completely.

Instead of guessing, you begin asking structured questions:

- Did the firmware detect the storage device?
- Was the bootloader executed?
- Did GRUB successfully load the kernel?
- Was the initramfs loaded?
- Were storage drivers available?
- Was the LVM volume group activated?
- Did the kernel successfully mount the root filesystem?
- Was PID 1 started?

Each answer narrows the scope of the investigation.

This systematic approach is what separates experienced infrastructure engineers from administrators who rely solely on memorized commands.

---

# The Boot Process Begins Before Linux Exists

One common misconception is that Linux starts executing as soon as the power button is pressed.

In reality, Linux is not involved during the earliest stages of the startup process.

When the power button is pressed, the operating system does not yet exist in memory.

Instead, the following events occur:

```
Power Button Pressed
        │
        ▼
Power Supply Stabilizes
        │
        ▼
CPU Reset
        │
        ▼
Firmware Starts (BIOS / UEFI)
        │
        ▼
Hardware Initialization
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--12"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--13"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>At this moment:

- No Linux kernel is running.
- No GRUB menu has appeared.
- No filesystem has been mounted.
- No storage driver has been loaded.

The only software executing is the firmware stored on the motherboard.

Its responsibility is to prepare the hardware so that an operating system can eventually be loaded.

This distinction is important because failures occurring before the bootloader appears are **not Linux problems**. They are firmware or hardware problems.

For example:

- Defective memory modules.
- Failed CPU initialization.
- Corrupted BIOS settings.
- Missing boot devices.
- Incorrect boot order.
- Failed power-on self-test (POST).

Trying to repair GRUB or rebuild an initramfs will never solve these issues because Linux has not yet started.

---

## Engineering Insight

One of the most common troubleshooting mistakes is attempting to fix a problem in the wrong stage of the boot process.

For example, rebuilding the initramfs will not help if the firmware cannot detect the boot disk. Likewise, reinstalling GRUB will not resolve a missing LVM volume that prevents the root filesystem from being mounted.

Always identify **where** the boot sequence stops before deciding **how** to fix it. Correctly identifying the failed stage often eliminates the majority of possible root causes and leads to a much faster, evidence-based investigation.

# IEN-002 - Stage 1 — Firmware Initialization (BIOS & UEFI)

Before Linux, before GRUB, and even before the operating system exists, the computer must first prepare itself to execute software.

This responsibility belongs to the system firmware.

For decades this firmware was known as the **Basic Input/Output System (BIOS)**. Modern systems have largely replaced BIOS with the **Unified Extensible Firmware Interface (UEFI)**, but regardless of the implementation, both serve the same fundamental purpose:

> Initialize the hardware and locate a bootable operating system.

Without firmware, the processor has no knowledge of memory, storage devices, keyboards, displays, or even where the operating system is stored.

The firmware acts as the bridge between powered hardware and the operating system.

---

# What Happens When You Press the Power Button?

Although pressing the power button appears to be a single action, it actually triggers a carefully coordinated sequence of hardware events.

```
Power Button
      │
      ▼
Power Supply Starts
      │
      ▼
Voltage Stabilizes
      │
      ▼
CPU Reset
      │
      ▼
Firmware Execution
      │
      ▼
Hardware Initialization
      │
      ▼
POST
      │
      ▼
Boot Device Selection
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--1"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--2"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Let's examine each step.

---

## Step 1 — Power Supply Initialization

When the power button is pressed, the motherboard sends a signal to the power supply unit (PSU).

The PSU does not immediately provide full power to the system.

Instead, it gradually stabilizes all required voltage rails, such as:

- +12V
- +5V
- +3.3V

Only after these voltages become stable does the PSU assert a signal commonly called **Power Good (PWR\_OK)**.

This signal tells the motherboard:

> "The electrical power is stable. The processor may begin execution."

If the PSU never asserts this signal, the CPU never starts.

---

## Step 2 — CPU Reset

Once power is stable, the processor exits its reset state.

An important question arises:

**How does the CPU know what instruction to execute first?**

The answer is surprisingly simple.

The processor does **not** search the hard drive.

It does **not** search memory.

Instead, every CPU contains a predefined **Reset Vector**.

Immediately after reset, the CPU jumps to this fixed memory location.

Historically, on x86 processors, this address is:

```
FFFF:0000
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--5"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--6"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or, in physical addressing,

```
0xFFFFFFF0
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--7"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--8"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This location is mapped to firmware stored in non-volatile memory on the motherboard.

The CPU therefore begins executing firmware instructions—not Linux.

---

## Engineering Insight

Many engineers imagine the CPU "looking for Linux."

It doesn't.

The CPU blindly executes the instruction located at the reset vector.

Everything else—including loading Linux—is performed later by firmware.

---

# Step 3 — Firmware Execution

At this point the firmware begins running.

Depending on the system, this firmware may be:

- Legacy BIOS
- Modern UEFI firmware

Although their implementations differ significantly, both begin by initializing the computer's hardware.

Typical initialization includes:

- CPU configuration
- Memory controller initialization
- RAM detection
- PCIe device discovery
- USB controller initialization
- SATA/NVMe controller initialization
- Keyboard detection
- Display initialization

Without this initialization, the operating system would have no usable hardware.

---

# POST (Power-On Self-Test)

One of the firmware's first major responsibilities is performing the **Power-On Self-Test**, commonly called **POST**.

POST verifies that essential hardware components are functional before attempting to boot an operating system.

Typical checks include:

<div class="TyagGW_tableContainer" id="bkmrk-component-purpose-cp"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="4090" data-start="3790"><thead data-end="3813" data-start="3790"><tr data-end="3813" data-start="3790"><th class="last:pe-10" data-col-size="sm" data-end="3802" data-start="3790">Component</th><th class="last:pe-10" data-col-size="sm" data-end="3813" data-start="3802">Purpose</th></tr></thead><tbody data-end="4090" data-start="3838"><tr data-end="3883" data-start="3838"><td data-col-size="sm" data-end="3844" data-start="3838">CPU</td><td data-col-size="sm" data-end="3883" data-start="3844">Verify processor responds correctly</td></tr><tr data-end="3917" data-start="3884"><td data-col-size="sm" data-end="3890" data-start="3884">RAM</td><td data-col-size="sm" data-end="3917" data-start="3890">Detect installed memory</td></tr><tr data-end="3963" data-start="3918"><td data-col-size="sm" data-end="3934" data-start="3918">Video Adapter</td><td data-col-size="sm" data-end="3963" data-start="3934">Initialize display output</td></tr><tr data-end="3998" data-start="3964"><td data-col-size="sm" data-end="3975" data-start="3964">Keyboard</td><td data-col-size="sm" data-end="3998" data-start="3975">Verify input device</td></tr><tr data-end="4037" data-start="3999"><td data-col-size="sm" data-end="4021" data-start="3999">Storage Controllers</td><td data-col-size="sm" data-end="4037" data-start="4021">Detect disks</td></tr><tr data-end="4090" data-start="4038"><td data-col-size="sm" data-end="4059" data-start="4038">Firmware Integrity</td><td data-col-size="sm" data-end="4090" data-start="4059">Validate firmware operation</td></tr></tbody></table>

</div></div>If a critical failure occurs, the boot process stops immediately.

Examples include:

- Missing RAM
- CPU initialization failure
- Corrupted firmware
- No graphics initialization (depending on platform)

Many servers report POST failures through:

- Beep codes
- Seven-segment diagnostic displays
- Front-panel LEDs
- IPMI/BMC event logs

Enterprise servers from vendors such as Dell, HPE, Lenovo, Inspur, and Supermicro often expose POST events through their management controllers.

---

# Hardware Discovery

After POST completes successfully, firmware begins discovering available hardware.

Modern systems may contain dozens or even hundreds of devices.

Examples include:

```
CPU

Memory

PCIe Devices

NICs

RAID Controllers

HBAs

NVMe Drives

USB Controllers

Graphics Adapters
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--13"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--14"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Each discovered device receives system resources such as:

- Memory addresses
- Interrupt assignments
- PCI bus numbers

Only after this discovery phase can the operating system communicate with the hardware.

---

# BIOS vs UEFI

Both BIOS and UEFI prepare the system for booting, but they are fundamentally different architectures.

<div class="TyagGW_tableContainer" id="bkmrk-bios-uefi-introduced"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="5624" data-start="5224"><thead data-end="5239" data-start="5224"><tr data-end="5239" data-start="5224"><th class="last:pe-10" data-col-size="sm" data-end="5231" data-start="5224">BIOS</th><th class="last:pe-10" data-col-size="md" data-end="5239" data-start="5231">UEFI</th></tr></thead><tbody data-end="5624" data-start="5256"><tr data-end="5314" data-start="5256"><td data-col-size="sm" data-end="5282" data-start="5256">Introduced in the 1980s</td><td data-col-size="md" data-end="5314" data-start="5282">Modern firmware architecture</td></tr><tr data-end="5368" data-start="5315"><td data-col-size="sm" data-end="5336" data-start="5315">16-bit environment</td><td data-col-size="md" data-end="5368" data-start="5336">32-bit or 64-bit environment</td></tr><tr data-end="5414" data-start="5369"><td data-col-size="sm" data-end="5391" data-start="5369">MBR partition table</td><td data-col-size="md" data-end="5414" data-start="5391">GPT partition table</td></tr><tr data-end="5471" data-start="5415"><td data-col-size="sm" data-end="5442" data-start="5415">Maximum disk size ≈ 2 TB</td><td data-col-size="md" data-end="5471" data-start="5442">Supports very large disks</td></tr><tr data-end="5537" data-start="5472"><td data-col-size="sm" data-end="5505" data-start="5472">Limited firmware functionality</td><td data-col-size="md" data-end="5537" data-start="5505">Extensible firmware services</td></tr><tr data-end="5624" data-start="5538"><td data-col-size="sm" data-end="5569" data-start="5538">Loads boot code from the MBR</td><td data-col-size="md" data-end="5624" data-start="5569">Loads EFI executables from the EFI System Partition</td></tr></tbody></table>

</div></div>Legacy BIOS executes the first sector of the selected boot disk, known as the **Master Boot Record (MBR)**.

UEFI works differently.

Instead of executing raw boot code from the first sector, it loads an EFI application stored inside a dedicated **EFI System Partition (ESP)**.

For Linux systems, this EFI application is often GRUB or another EFI-compatible bootloader.

---

## Engineering Insight

One common misconception is that UEFI is simply a "new BIOS."

In reality, UEFI is a complete firmware platform with its own filesystem support, boot manager, runtime services, and application loader. Unlike BIOS, which merely executes the first sector of a disk, UEFI can directly read files from the EFI System Partition and launch EFI executables.

---

# Selecting the Boot Device

Once hardware initialization is complete, the firmware must decide **which device to boot from**.

Typical boot devices include:

- SATA SSD
- NVMe SSD
- SAS Disk
- USB Flash Drive
- DVD
- PXE Network Boot
- iSCSI Boot
- Fibre Channel SAN

The firmware follows its configured boot order.

For example:

```
1. NVMe SSD
2. SATA SSD
3. PXE Network
4. USB
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--18"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--19"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>It attempts each device until a valid boot target is found.

If no bootable device is available, booting stops before Linux is ever loaded.

Typical messages include:

```
No Boot Device Found
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--20"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--21"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Operating System Not Found
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--22"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--23"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Insert Boot Media
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--24"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--25"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>These errors are frequently mistaken for Linux problems, but they actually indicate that the firmware could not locate a bootable operating system.

---

# Where Can Things Go Wrong?

Understanding common failures at this stage helps narrow down troubleshooting quickly.

<div class="TyagGW_tableContainer" id="bkmrk-symptom-likely-cause"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="7773" data-start="7328"><thead data-end="7371" data-start="7328"><tr data-end="7371" data-start="7328"><th class="last:pe-10" data-col-size="sm" data-end="7338" data-start="7328">Symptom</th><th class="last:pe-10" data-col-size="md" data-end="7353" data-start="7338">Likely Cause</th><th class="last:pe-10" data-col-size="sm" data-end="7371" data-start="7353">Linux Running?</th></tr></thead><tbody data-end="7773" data-start="7416"><tr data-end="7478" data-start="7416"><td data-col-size="sm" data-end="7443" data-start="7416">System does not power on</td><td data-col-size="md" data-end="7470" data-start="7443">PSU or motherboard issue</td><td data-col-size="sm" data-end="7478" data-start="7470">❌ No</td></tr><tr data-end="7551" data-start="7479"><td data-col-size="sm" data-end="7503" data-start="7479">Continuous beep codes</td><td data-col-size="md" data-end="7543" data-start="7503">Hardware failure detected during POST</td><td data-col-size="sm" data-end="7551" data-start="7543">❌ No</td></tr><tr data-end="7618" data-start="7552"><td data-col-size="sm" data-end="7578" data-start="7552">Memory training failure</td><td data-col-size="md" data-end="7610" data-start="7578">Defective or incompatible RAM</td><td data-col-size="sm" data-end="7618" data-start="7610">❌ No</td></tr><tr data-end="7696" data-start="7619"><td data-col-size="sm" data-end="7644" data-start="7619">"No Boot Device Found"</td><td data-col-size="md" data-end="7688" data-start="7644">Disk not detected or incorrect boot order</td><td data-col-size="sm" data-end="7696" data-start="7688">❌ No</td></tr><tr data-end="7773" data-start="7697"><td data-col-size="sm" data-end="7728" data-start="7697">"Operating System Not Found"</td><td data-col-size="md" data-end="7760" data-start="7728">Missing or damaged bootloader</td><td data-col-size="sm" data-end="7773" data-start="7760">❌ Not yet</td></tr></tbody></table>

</div></div>Notice that **Linux has not started in any of these scenarios**. Rebuilding `initramfs`, reinstalling GRUB, or repairing filesystems would not resolve problems that occur before the firmware successfully hands control to the bootloader.

---

# Summary

The firmware stage is responsible for preparing the system to run an operating system. It initializes hardware, performs POST, discovers available devices, and selects a bootable storage device. Only after these tasks are completed does it transfer control to the bootloader.

This stage forms the foundation of the entire boot process. If firmware initialization fails, Linux never has the opportunity to start.

# IEN-003 - Stage 2 — The Bootloader (GRUB)

At the end of the firmware stage, the computer has completed its hardware initialization and identified a bootable storage device.

However, the firmware still faces one fundamental problem:

> It knows **where** the operating system is stored, but it does **not know how to load it**.

This is where the bootloader comes into play.

The bootloader acts as the bridge between the firmware and the operating system. Its primary responsibility is to locate the Linux kernel, load it into memory, provide the necessary boot parameters, load the initial RAM disk (`initrd` or `initramfs`), and finally transfer execution to the kernel.

Without a bootloader, the firmware has no knowledge of Linux-specific file formats, filesystem layouts, or kernel images.

The bootloader is therefore the **first piece of software that understands how to start Linux**.

---

# Why Do We Need a Bootloader?

A common misconception is that the firmware could simply load the Linux kernel directly.

While this is technically possible in certain specialized systems, it is not how general-purpose computers are designed.

The firmware is intentionally kept generic. It can initialize hardware and locate a bootable device, but it does not understand:

- Linux kernels
- Windows boot managers
- FreeBSD kernels
- Multiple operating systems
- Kernel command-line arguments
- Recovery modes

Instead, the firmware loads a small program whose sole purpose is boot management.

That program is the bootloader.

Its responsibilities include:

- Presenting a boot menu.
- Selecting an operating system.
- Loading the kernel into memory.
- Loading the initial RAM disk.
- Passing boot parameters to the kernel.
- Supporting recovery and rescue modes.

---

# The Boot Sequence So Far

At this point, the startup sequence looks like this:

```
Power On
    │
    ▼
Firmware (BIOS / UEFI)
    │
    ▼
POST
    │
    ▼
Boot Device Selected
    │
    ▼
Bootloader (GRUB)
    │
    ▼
Linux Kernel
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--2"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--3"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Notice that Linux itself is **still not running**.

GRUB is responsible for preparing everything the kernel needs before handing over control.

---

# A Brief History of Linux Bootloaders

Before GRUB became the de facto standard, Linux systems used several different bootloaders.

Some of the most well-known include:

<div class="TyagGW_tableContainer" id="bkmrk-bootloader-status-no"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="3096" data-start="2675"><thead data-end="2706" data-start="2675"><tr data-end="2706" data-start="2675"><th class="last:pe-10" data-col-size="sm" data-end="2688" data-start="2675">Bootloader</th><th class="last:pe-10" data-col-size="sm" data-end="2697" data-start="2688">Status</th><th class="last:pe-10" data-col-size="md" data-end="2706" data-start="2697">Notes</th></tr></thead><tbody data-end="3096" data-start="2739"><tr data-end="2843" data-start="2739"><td data-col-size="sm" data-end="2746" data-start="2739">LILO</td><td data-col-size="sm" data-end="2755" data-start="2746">Legacy</td><td data-col-size="md" data-end="2843" data-start="2755">One of the earliest Linux bootloaders. Required reinstallation after kernel changes.</td></tr><tr data-end="2933" data-start="2844"><td data-col-size="sm" data-end="2858" data-start="2844">GRUB Legacy</td><td data-col-size="sm" data-end="2867" data-start="2858">Legacy</td><td data-col-size="md" data-end="2933" data-start="2867">Widely used by RHEL 5, CentOS 5, and many older distributions.</td></tr><tr data-end="3012" data-start="2934"><td data-col-size="sm" data-end="2942" data-start="2934">GRUB2</td><td data-col-size="sm" data-end="2952" data-start="2942">Current</td><td data-col-size="md" data-end="3012" data-start="2952">Successor to GRUB Legacy. More modular and feature-rich.</td></tr><tr data-end="3096" data-start="3013"><td data-col-size="sm" data-end="3028" data-start="3013">systemd-boot</td><td data-col-size="sm" data-end="3038" data-start="3028">Current</td><td data-col-size="md" data-end="3096" data-start="3038">Lightweight bootloader primarily used on UEFI systems.</td></tr></tbody></table>

</div></div>Because much of the *Infrastructure Engineering Notes* series focuses on enterprise environments—including legacy systems such as RHEL 5—we will encounter both **GRUB Legacy** and **GRUB2**.

Understanding their differences is essential when performing recovery operations.

---

# GRUB Legacy vs GRUB2

Although both bootloaders share the same goal, their internal design differs considerably.

<div class="TyagGW_tableContainer" id="bkmrk-feature-grub-legacy-"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="3937" data-start="3494"><thead data-end="3527" data-start="3494"><tr data-end="3527" data-start="3494"><th class="last:pe-10" data-col-size="sm" data-end="3504" data-start="3494">Feature</th><th class="last:pe-10" data-col-size="sm" data-end="3518" data-start="3504">GRUB Legacy</th><th class="last:pe-10" data-col-size="md" data-end="3527" data-start="3518">GRUB2</th></tr></thead><tbody data-end="3937" data-start="3563"><tr data-end="3646" data-start="3563"><td data-col-size="sm" data-end="3587" data-start="3563">Typical distributions</td><td data-col-size="sm" data-end="3606" data-start="3587">RHEL 5, CentOS 5</td><td data-col-size="md" data-end="3646" data-start="3606">RHEL 7+, Ubuntu, Debian, Rocky Linux</td></tr><tr data-end="3742" data-start="3647"><td data-col-size="sm" data-end="3668" data-start="3647">Configuration file</td><td data-col-size="sm" data-end="3693" data-start="3668">`/boot/grub/grub.conf`</td><td data-col-size="md" data-end="3742" data-start="3693">`/boot/grub2/grub.cfg` or `/boot/efi/EFI/...`</td></tr><tr data-end="3814" data-start="3743"><td data-col-size="sm" data-end="3770" data-start="3743">Configuration generation</td><td data-col-size="sm" data-end="3787" data-start="3770">Manual editing</td><td data-col-size="md" data-end="3814" data-start="3787">Automatically generated</td></tr><tr data-end="3866" data-start="3815"><td data-col-size="sm" data-end="3832" data-start="3815">Module support</td><td data-col-size="sm" data-end="3842" data-start="3832">Limited</td><td data-col-size="md" data-end="3866" data-start="3842">Modular architecture</td></tr><tr data-end="3909" data-start="3867"><td data-col-size="sm" data-end="3888" data-start="3867">Filesystem support</td><td data-col-size="sm" data-end="3896" data-start="3888">Basic</td><td data-col-size="md" data-end="3909" data-start="3896">Extensive</td></tr><tr data-end="3937" data-start="3910"><td data-col-size="sm" data-end="3925" data-start="3910">UEFI support</td><td data-col-size="sm" data-end="3930" data-start="3925">No</td><td data-col-size="md" data-end="3937" data-start="3930">Yes</td></tr></tbody></table>

</div></div>One important point is that **GRUB2 is not simply a newer version of GRUB Legacy**. It is a complete redesign.

For example, on RHEL 5 you typically edit `grub.conf` directly. On modern systems, editing `grub.cfg` manually is discouraged because it is generated automatically from configuration templates.

This distinction becomes important during recovery scenarios.

---

# Inside GRUB Legacy

Under legacy BIOS systems, GRUB is traditionally divided into multiple stages.

```
+----------------------+
| Stage 1              |
| (MBR)                |
+----------+-----------+
           │
           ▼
+----------------------+
| Stage 1.5            |
| Filesystem Support   |
+----------+-----------+
           │
           ▼
+----------------------+
| Stage 2              |
| Full GRUB            |
+----------+-----------+
           │
           ▼
Read grub.conf
           │
           ▼
Load Kernel
           │
           ▼
Load initrd
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--7"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--8"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Let's examine each stage.

### Stage 1

Stage 1 occupies the first 446 bytes of the Master Boot Record (MBR).

Its size is extremely limited, so it cannot understand filesystems or locate the Linux kernel directly.

Its only responsibility is to load the next stage.

---

### Stage 1.5

Stage 1.5 resides immediately after the MBR in the so-called *embedding area*.

Unlike Stage 1, it contains basic filesystem drivers.

This allows GRUB to read files from partitions such as ext2 or ext3.

Without Stage 1.5, Stage 1 would have no way to locate the full GRUB program stored within the filesystem.

---

### Stage 2

Stage 2 is the full bootloader.

It provides:

- Interactive command line.
- Boot menu.
- Configuration parsing.
- Filesystem access.
- Kernel loading.
- initrd loading.
- Recovery options.

When users refer to "GRUB," they are usually interacting with Stage 2.

---

# The GRUB Configuration File

Once Stage 2 starts, GRUB searches for its configuration file.

On GRUB Legacy systems, this file is usually:

```
/boot/grub/grub.conf
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--12"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--13"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
/boot/grub/menu.lst
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--14"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--15"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The configuration file defines:

- Available operating systems.
- Default boot entry.
- Boot timeout.
- Kernel image location.
- initrd image location.
- Kernel parameters.

A simplified example looks like this:

```
title Red Hat Enterprise Linux

root (hd0,0)

kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00

initrd /initrd-2.6.18-128.el5.img
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--16"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--17"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Each line has a specific purpose:

- `root (hd0,0)` tells GRUB where to find the `/boot` partition.
- `kernel` specifies the kernel image and its boot parameters.
- `initrd` points to the initial RAM disk required during early boot.

If any of these paths are incorrect, GRUB may fail before the Linux kernel even begins execution.

---

## Engineering Insight

One of the most common production issues after restoring or cloning a server is that the kernel and `initrd` files no longer match the entries in `grub.conf`. GRUB itself is functioning correctly, but it is instructed to load files that no longer exist or belong to a different kernel version. The result can range from a simple "File not found" message to a kernel panic later in the boot process.

This is exactly the type of issue we encountered during our RHEL 5.2 recovery project, and we will revisit it in detail later in this series.

---

# Loading the Linux Kernel

Once a boot entry is selected, GRUB performs one of its most important tasks: loading the Linux kernel into memory.

At this stage, the kernel is still just a compressed binary file stored on disk.

GRUB reads this file from the `/boot` filesystem, copies it into RAM, and prepares the execution environment.

Immediately afterward, it loads the corresponding `initrd` (or `initramfs`) image into memory as well.

Only when both components are ready does GRUB transfer control to the Linux kernel.

From that moment onward, the bootloader's job is complete.

The Linux kernel takes over, and the boot process enters its next stage.

---

# Common Bootloader Failures

Understanding common failures helps quickly identify whether a problem belongs to the bootloader stage.

<div class="TyagGW_tableContainer" id="bkmrk-symptom-likely-cause"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="8482" data-start="8080"><thead data-end="8106" data-start="8080"><tr data-end="8106" data-start="8080"><th class="last:pe-10" data-col-size="sm" data-end="8090" data-start="8080">Symptom</th><th class="last:pe-10" data-col-size="md" data-end="8106" data-start="8090">Likely Cause</th></tr></thead><tbody data-end="8482" data-start="8134"><tr data-end="8189" data-start="8134"><td data-col-size="sm" data-end="8151" data-start="8134">`grub>` prompt</td><td data-col-size="md" data-end="8189" data-start="8151">Missing or incorrect configuration</td></tr><tr data-end="8255" data-start="8190"><td data-col-size="sm" data-end="8207" data-start="8190">`grub rescue>`</td><td data-col-size="md" data-end="8255" data-start="8207">GRUB cannot locate its modules or filesystem</td></tr><tr data-end="8323" data-start="8256"><td data-col-size="sm" data-end="8285" data-start="8256">`Error 15: File not found`</td><td data-col-size="md" data-end="8323" data-start="8285">Kernel or initrd path is incorrect</td></tr><tr data-end="8401" data-start="8324"><td data-col-size="sm" data-end="8347" data-start="8324">`Unknown filesystem`</td><td data-col-size="md" data-end="8401" data-start="8347">Filesystem driver unavailable or partition damaged</td></tr><tr data-end="8482" data-start="8402"><td data-col-size="sm" data-end="8430" data-start="8402">Boot menu does not appear</td><td data-col-size="md" data-end="8482" data-start="8430">Corrupted GRUB installation or wrong boot target</td></tr></tbody></table>

</div></div>A key observation is that **none of these errors originate from the Linux kernel**. They occur **before** the kernel starts executing.

---

# Summary

The bootloader is responsible for bridging the gap between firmware and the Linux kernel. It locates the kernel image, loads the initial RAM disk, passes kernel parameters, and transfers control to the operating system.

A failure at this stage prevents Linux from starting entirely, making it essential to distinguish bootloader issues from kernel or userspace problems.

# IEN-004 - Stage 3 — Linux Kernel Initialization

At the end of the previous stage, GRUB has successfully loaded two critical files into memory:

- the Linux kernel (`vmlinuz`)
- the initial RAM disk (`initrd` or `initramfs`)

It has also prepared the kernel command line, which may include parameters such as:

```
root=/dev/mapper/vg_root-lv_root ro rhgb quiet
```

<div class="relative w-full mt-4 mb-1" id="bkmrk-"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--1"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
root=UUID=0d6d0b68-8d95-42d6-bf7c-8a88f6b82d5e
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--2"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--3"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or, as we encountered during our RHEL 5.2 recovery project:

```
acpi=no
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--4"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--5"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>At this point, everything the kernel needs has been placed into memory.

GRUB's work is complete.

The CPU now performs one of the most significant transitions during the entire startup sequence:

> **Execution is transferred from the bootloader to the Linux kernel.**

From this moment onward, Linux—not the firmware or GRUB—is responsible for bringing the system to life.

---

# The Kernel Is Not Yet an Operating System

Many people think Linux "starts" the moment GRUB loads the kernel.

Technically, that is not true.

The kernel is only a binary image stored in memory.

It has not yet:

- initialized memory management,
- detected storage devices,
- mounted a filesystem,
- started services,
- or launched user-space processes.

Think of the kernel as the blueprint of a city before any roads, electricity, or buildings have been constructed.

The blueprint exists—but the city is not operational.

The first responsibility of the kernel is therefore to build its own operating environment.

---

# From Compressed Image to Running Kernel

The kernel image stored in `/boot` is typically compressed.

On most systems, the file looks something like:

```
vmlinuz-5.14.0-503.el9.x86_64
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--8"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--9"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Notice the name:

```
vmlinuz
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--10"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--11"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The "z" indicates that the kernel image is compressed.

Why?

Because compressed kernels:

- require less disk space,
- reduce bootloader loading time,
- and minimize storage requirements.

Immediately after execution begins, the kernel performs its own decompression.

A simplified sequence looks like this:

```
GRUB
    │
    ▼
Load compressed kernel
    │
    ▼
Jump to kernel entry point
    │
    ▼
Kernel decompression
    │
    ▼
Kernel relocates itself
    │
    ▼
Kernel begins initialization
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--12"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--13"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Only after decompression does the actual kernel begin executing.

---

# Setting Up the CPU

The very first task of the kernel is preparing the processor.

Although the firmware has already initialized the CPU enough to execute code, Linux requires far more control.

The kernel configures features such as:

- processor operating mode,
- interrupt handling,
- exception handlers,
- floating-point support,
- cache management,
- CPU feature detection,
- multiple processor initialization (SMP).

Modern systems may contain dozens or even hundreds of CPU cores.

The kernel must detect every available processor and prepare them for scheduling.

Typical kernel messages include:

```
SMP: Total of 32 processors activated.
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--15"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--16"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Detected 16 logical CPUs.
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--17"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--18"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>At this stage, only a very small portion of the kernel is active.

---

# Memory Initialization

Once the processor is ready, the kernel turns its attention to memory.

RAM is the foundation upon which every process, filesystem cache, driver, and application depends.

The kernel must determine:

- how much memory is installed,
- which regions are usable,
- which regions are reserved,
- where the kernel itself resides,
- where future allocations can occur.

A simplified memory map might look like this:

```
+------------------------------+
| Kernel Image                 |
+------------------------------+
| Reserved Firmware Memory     |
+------------------------------+
| DMA Region                   |
+------------------------------+
| Available RAM                |
+------------------------------+
| High Memory                  |
+------------------------------+
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--20"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--21"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>From this point onward, Linux begins managing memory instead of relying on firmware.

This transition is fundamental because all future allocations—processes, drivers, caches, page tables—depend on the kernel's memory manager.

---

## Engineering Insight

One of Linux's greatest strengths is that the firmware is only needed during the earliest stages of boot.

Once initialization is complete, the kernel takes full ownership of system resources.

From this point forward, Linux manages memory, processors, interrupts, and devices independently of the firmware.

---

# Initializing Core Kernel Subsystems

With the CPU and memory prepared, the kernel begins activating its internal subsystems.

These subsystems provide the fundamental services required by every part of the operating system.

Examples include:

- Scheduler
- Virtual Memory Manager
- Interrupt Manager
- Timer Subsystem
- Process Manager
- Virtual Filesystem (VFS)
- Security Frameworks
- IPC Mechanisms

You can think of these as the "operating system inside the operating system."

Without them, Linux cannot execute processes or communicate with hardware.

---

# Device Driver Initialization

Once the kernel infrastructure is operational, Linux begins initializing device drivers.

Drivers are responsible for communicating with hardware such as:

- SATA controllers,
- NVMe controllers,
- RAID controllers,
- Fibre Channel HBAs,
- USB controllers,
- Ethernet adapters,
- GPUs,
- storage controllers.

A simplified sequence is shown below:

```
Kernel
    │
    ▼
PCI Bus Scan
    │
    ▼
Device Discovery
    │
    ▼
Match Driver
    │
    ▼
Initialize Device
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--25"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--26"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This process is essential.

If the kernel lacks the driver required for the storage controller containing the root filesystem, the boot process cannot continue.

---

# The Kernel Still Cannot Access the Root Filesystem

This surprises many engineers.

At this point the kernel has:

- initialized memory,
- initialized processors,
- activated internal subsystems,
- detected hardware,
- loaded some drivers,

yet it **still cannot mount the root filesystem**.

Why?

Because the storage stack may not yet be complete.

Enterprise Linux systems commonly use technologies such as:

- LVM
- Software RAID
- Multipath
- Fibre Channel SAN
- iSCSI
- NVMe over Fabrics

The kernel alone often does not have enough information or modules to activate these storage layers.

It therefore requires assistance from another component:

> **The Initial RAM Disk (initrd/initramfs).**

This is precisely why the bootloader loaded the initrd alongside the kernel.

The kernel's next step is to unpack that temporary root filesystem and execute its `/init` program.

---

# Common Kernel Initialization Failures

Many boot failures occur during kernel initialization.

Some of the most common include:

<div class="TyagGW_tableContainer" id="bkmrk-symptom-likely-cause"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="7526" data-start="7154"><thead data-end="7180" data-start="7154"><tr data-end="7180" data-start="7154"><th class="last:pe-10" data-col-size="sm" data-end="7164" data-start="7154">Symptom</th><th class="last:pe-10" data-col-size="sm" data-end="7180" data-start="7164">Likely Cause</th></tr></thead><tbody data-end="7526" data-start="7208"><tr data-end="7261" data-start="7208"><td data-col-size="sm" data-end="7239" data-start="7208">`Kernel panic - not syncing`</td><td data-col-size="sm" data-end="7261" data-start="7239">Fatal kernel error</td></tr><tr data-end="7327" data-start="7262"><td data-col-size="sm" data-end="7290" data-start="7262">`Unable to mount root fs`</td><td data-col-size="sm" data-end="7327" data-start="7290">Root filesystem cannot be located</td></tr><tr data-end="7389" data-start="7328"><td data-col-size="sm" data-end="7354" data-start="7328">`No working init found`</td><td data-col-size="sm" data-end="7389" data-start="7354">`/init` or `/sbin/init` missing</td></tr><tr data-end="7443" data-start="7390"><td data-col-size="sm" data-end="7413" data-start="7390">`Unknown-block(0,0)`</td><td data-col-size="sm" data-end="7443" data-start="7413">Storage device unavailable</td></tr><tr data-end="7526" data-start="7444"><td data-col-size="sm" data-end="7487" data-start="7444">System freezes after "Loading kernel..."</td><td data-col-size="sm" data-end="7526" data-start="7487">Early kernel initialization failure</td></tr></tbody></table>

</div></div>A crucial point to remember is that a **kernel panic** does **not** always mean the kernel itself is defective.

In many cases, the kernel is functioning correctly but cannot proceed because it lacks access to the storage or userspace required for the next stage.

Understanding exactly **where** the panic occurs is therefore far more valuable than the panic message alone.

---

## Engineering Insight

One of the most misunderstood boot errors is:

```
Kernel panic - not syncing:
VFS: Unable to mount root fs
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--30"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--31"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Although the message contains the words *Kernel panic*, the underlying problem is frequently **not the kernel binary itself**. More commonly, the kernel cannot locate or access the root filesystem because the required storage driver, LVM activation, RAID assembly, or filesystem module is unavailable. Treating every kernel panic as a "kernel problem" often leads engineers in the wrong direction.

---

# Summary

By the end of this stage, the Linux kernel has transformed from a compressed image on disk into a running operating system core. It has initialized the CPU, taken control of memory management, activated its internal subsystems, and begun communicating with hardware through device drivers.

However, the system is still incomplete. The kernel knows **how** to manage hardware, but it may not yet know **where** the real root filesystem resides.

To bridge that gap, the kernel hands control to the **initial RAM disk (`initrd`/`initramfs`)**, which will load any remaining drivers, activate storage technologies such as LVM or RAID, and prepare the real root filesystem for mounting.

# IEN-005 - Stage 4 — initrd / initramfs: Preparing the System to Mount the Root Filesystem

By the end of the previous stage, the Linux kernel is fully operational.

It has:

- initialized the processor,
- taken control of memory management,
- started its internal subsystems,
- detected hardware,
- initialized built-in device drivers.

Despite all of this progress, the system still cannot boot completely.

One critical problem remains.

> **The kernel still does not know how to access the real root filesystem.**

This may sound surprising.

After all, the kernel was loaded from the disk.

Shouldn't it already know where the operating system is?

The answer is:

**Not necessarily.**

Modern Linux systems often place the root filesystem behind one or more abstraction layers.

For example:

```
Disk
 │
 ▼
RAID
 │
 ▼
LVM
 │
 ▼
Filesystem
 │
 ▼
Root (/)
```

<div class="relative w-full mt-4 mb-1" id="bkmrk-"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--1"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Disk
 │
 ▼
Multipath
 │
 ▼
LVM
 │
 ▼
Filesystem
 │
 ▼
Root (/)
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--2"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--3"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or even

```
SAN Storage
 │
 ▼
Fibre Channel
 │
 ▼
Multipath
 │
 ▼
LVM
 │
 ▼
XFS
 │
 ▼
Root (/)
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--4"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--5"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>At this moment, the kernel has not yet assembled these storage layers.

It cannot simply mount `/`.

Something else must prepare the environment first.

That "something" is the **Initial RAM Disk**, commonly known as **initrd** or **initramfs**.

---

# Why Does initrd Exist?

To understand why initrd exists, let's look at the history of Linux.

In the early days, Linux systems were much simpler.

A typical machine looked like this:

```
IDE Disk
    │
    ▼
ext2 Filesystem
    │
    ▼
Root Filesystem
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--7"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--8"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The kernel already contained all required drivers.

Booting was straightforward.

Kernel

↓

Mount Root

↓

Start init

No temporary filesystem was necessary.

---

As Linux evolved, systems became significantly more complex.

Modern enterprise servers may use:

- LVM
- Software RAID
- Hardware RAID
- Multipath
- Fibre Channel SAN
- iSCSI
- NVMe
- Encrypted disks (LUKS)
- Network boot

Bundling every possible driver into the kernel would make it unnecessarily large and difficult to maintain.

Instead, Linux adopted a modular design.

Only essential components remain built into the kernel.

Additional modules are loaded during early boot from a temporary filesystem.

That temporary filesystem is initrd (or, on modern systems, initramfs).

---

# initrd vs initramfs

Although the terms are often used interchangeably, they are not identical.

<div class="TyagGW_tableContainer" id="bkmrk-initrd-initramfs-old"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="2993" data-start="2650"><thead data-end="2672" data-start="2650"><tr data-end="2672" data-start="2650"><th class="last:pe-10" data-col-size="md" data-end="2659" data-start="2650">initrd</th><th class="last:pe-10" data-col-size="sm" data-end="2672" data-start="2659">initramfs</th></tr></thead><tbody data-end="2993" data-start="2696"><tr data-end="2744" data-start="2696"><td data-col-size="md" data-end="2719" data-start="2696">Older implementation</td><td data-col-size="sm" data-end="2744" data-start="2719">Modern implementation</td></tr><tr data-end="2785" data-start="2745"><td data-col-size="md" data-end="2767" data-start="2745">Block device backed</td><td data-col-size="sm" data-end="2785" data-start="2767">RAM filesystem</td></tr><tr data-end="2873" data-start="2786"><td data-col-size="md" data-end="2835" data-start="2786">Used heavily by RHEL 5 and older distributions</td><td data-col-size="sm" data-end="2873" data-start="2835">Used by modern Linux distributions</td></tr><tr data-end="2945" data-start="2874"><td data-col-size="md" data-end="2910" data-start="2874">Typically created with `mkinitrd`</td><td data-col-size="sm" data-end="2945" data-start="2910">Typically created with `dracut`</td></tr><tr data-end="2993" data-start="2946"><td data-col-size="md" data-end="2962" data-start="2946">Less flexible</td><td data-col-size="sm" data-end="2993" data-start="2962">More flexible and efficient</td></tr></tbody></table>

</div></div>Because this series includes both legacy and modern Linux systems, we will use the term **initrd** when discussing older environments such as RHEL 5, and **initramfs** when referring to newer systems.

---

# What Is Inside initrd?

Many administrators think of initrd as a mysterious binary blob.

In reality, it is simply a compressed filesystem image containing everything needed to prepare the system for mounting the real root filesystem.

Typical contents include:

```
/init
/bin
/sbin
/lib
/lib/modules
/dev
/proc
/sys
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--12"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--13"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>More importantly, it contains:

- Storage drivers
- Filesystem drivers
- LVM tools
- RAID utilities
- Multipath utilities
- Device mapper support
- udev components

Think of initrd as a **miniature Linux system** whose only purpose is to prepare the real Linux system.

---

# Boot Flow with initrd

Once the kernel has completed its initialization, it unpacks the initrd into memory.

The process now looks like this:

```
GRUB
 │
 ▼
Kernel
 │
 ▼
Unpack initrd
 │
 ▼
Temporary Root Filesystem
 │
 ▼
Execute /init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--15"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--16"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Notice something important.

The kernel has **not** mounted the real root filesystem yet.

Instead, it mounts the temporary root filesystem provided by initrd.

From this point onward, the `/init` program inside initrd becomes responsible for preparing the real storage environment.

---

# What Happens Inside initrd?

This is where most enterprise boot logic takes place.

The `/init` program performs tasks such as:

1. Loading additional kernel modules.
2. Starting udev.
3. Detecting storage devices.
4. Loading storage controller drivers.
5. Detecting RAID arrays.
6. Activating LVM volume groups.
7. Starting multipath services.
8. Locating the root filesystem.
9. Mounting the real root filesystem.
10. Switching execution to the real system.

A simplified workflow looks like this:

```
Kernel
    │
    ▼
Execute /init
    │
    ▼
Load Modules
    │
    ▼
Detect Storage
    │
    ▼
Activate LVM
    │
    ▼
Locate Root Filesystem
    │
    ▼
Mount Root
    │
    ▼
switch_root
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--18"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--19"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>---

# LVM Activation

Let's focus on one of the most important steps.

Many enterprise Linux installations store the root filesystem inside LVM.

For example:

```
Disk
 │
 ▼
Physical Volume (PV)
 │
 ▼
Volume Group (VG)
 │
 ▼
Logical Volume (LV)
 │
 ▼
XFS / ext4
 │
 ▼
Root Filesystem
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--21"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--22"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The kernel cannot mount:

```
/dev/mapper/vg_root-lv_root
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--23"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--24"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>unless the Volume Group has already been activated.

That activation happens inside initrd.

Internally, tools equivalent to:

```
vgscan
vgchange -ay
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--25"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--26"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>(or their initramfs equivalents) make the logical volumes available before the root filesystem is mounted.

Without this step, the kernel has no device to mount as `/`.

---

## Engineering Insight

This explains why LVM-related boot failures almost always appear **before** the system reaches `systemd` or the login prompt. If the Volume Group cannot be activated during the initrd stage—because a Physical Volume is missing, metadata is corrupted, or the necessary LVM tools are absent—the root filesystem never becomes available. The kernel is left waiting for a device that does not exist, and the boot process cannot continue.

This is exactly the class of problem we encountered during the RHEL 5.2 recovery after the Acronis restore. The issue was not with the kernel itself, but with the early userspace environment failing to expose the expected storage layout.

---

# Device Discovery

While LVM is being activated, initrd also waits for storage devices to appear.

This includes:

- SATA disks
- SAS disks
- NVMe drives
- Fibre Channel LUNs
- iSCSI targets
- Multipath devices

Enterprise storage may require several seconds before all devices become available.

The initrd environment is responsible for waiting, probing, and assembling these devices before attempting to mount the root filesystem.

---

# switch\_root

Once the real root filesystem has been successfully mounted, the temporary initrd environment is no longer needed.

Instead of rebooting or restarting, Linux performs a handoff.

This operation is called **`switch_root`** (historically, some systems used `pivot_root`).

The transition looks like this:

```
Temporary Root (initrd)
        │
        ▼
Real Root Filesystem
        │
        ▼
switch_root
        │
        ▼
Execute /sbin/init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--30"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--31"><div class="cm-scroller">  
</div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>After this point, the initrd environment is discarded, and the real operating system takes over.

This is the first moment during the boot process where the system begins executing programs from the permanent root filesystem.

---

# Common initrd / initramfs Failures

Because initrd is responsible for preparing the storage stack, failures here are often related to storage, drivers, or root filesystem discovery.

<div class="TyagGW_tableContainer" id="bkmrk-symptom-likely-cause"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="8170" data-start="7776"><thead data-end="7802" data-start="7776"><tr data-end="7802" data-start="7776"><th class="last:pe-10" data-col-size="sm" data-end="7786" data-start="7776">Symptom</th><th class="last:pe-10" data-col-size="md" data-end="7802" data-start="7786">Likely Cause</th></tr></thead><tbody data-end="8170" data-start="7830"><tr data-end="7892" data-start="7830"><td data-col-size="sm" data-end="7859" data-start="7830">`dracut-initqueue timeout`</td><td data-col-size="md" data-end="7892" data-start="7859">Storage device never appeared</td></tr><tr data-end="7945" data-start="7893"><td data-col-size="sm" data-end="7920" data-start="7893">`Volume Group not found`</td><td data-col-size="md" data-end="7945" data-start="7920">LVM activation failed</td></tr><tr data-end="8020" data-start="7946"><td data-col-size="sm" data-end="7971" data-start="7946">`No root device found`</td><td data-col-size="md" data-end="8020" data-start="7971">Incorrect `root=` parameter or missing driver</td></tr><tr data-end="8104" data-start="8021"><td data-col-size="sm" data-end="8064" data-start="8021">`Kernel panic - unable to mount root fs`</td><td data-col-size="md" data-end="8104" data-start="8064">Root filesystem could not be mounted</td></tr><tr data-end="8170" data-start="8105"><td data-col-size="sm" data-end="8133" data-start="8105">`Waiting for root device`</td><td data-col-size="md" data-end="8170" data-start="8133">Storage initialization incomplete</td></tr></tbody></table>

</div></div>One important observation is that these errors occur **after the kernel has started**, but **before the real operating system begins**. Understanding that distinction helps avoid troubleshooting the wrong component.

---

# Summary

The initrd/initramfs stage bridges the gap between a running kernel and a usable operating system. It provides a temporary userspace where additional drivers can be loaded, storage technologies such as LVM and RAID can be activated, and the real root filesystem can be located and mounted.

Without this stage, many modern Linux systems would be unable to boot because the kernel alone lacks the information required to discover complex storage configurations.

# IEN-006 - Stage 5 — Mounting the Root Filesystem

After the initrd (or initramfs) has completed its work, the system finally reaches one of the most important milestones in the entire boot process:

> **The real root filesystem can now be mounted.**

Everything that happened before this point—from firmware initialization to loading storage drivers—had one ultimate goal:

**Make the root filesystem accessible.**

Only after the root filesystem is mounted can Linux begin executing the programs that make up the operating system itself.

---

# What Is the Root Filesystem?

Every Linux system has a directory called:

```
/
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--1"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--2"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This directory is known as the **root filesystem**.

It is the highest level of the Linux directory hierarchy.

Everything else exists beneath it.

For example:

```
/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── proc
├── root
├── run
├── sbin
├── sys
├── tmp
├── usr
└── var
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--3"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--4"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Every application, configuration file, shared library, and executable ultimately resides somewhere under this hierarchy.

Without the root filesystem, Linux has nowhere to find:

- `/bin/bash`
- `/etc/fstab`
- `/usr/bin`
- `/lib`
- `/sbin/init`

At this stage, these files still do **not** exist in the running environment.

The system is still operating from the temporary initrd.

---

# Temporary Root vs Real Root

One concept that often confuses Linux administrators is the existence of **two different root filesystems** during boot.

The first is the temporary root filesystem provided by initrd.

The second is the permanent root filesystem stored on disk.

```
Temporary Root (initrd)
        │
        ▼
Prepare Storage
        │
        ▼
Mount Real Root
        │
        ▼
switch_root
        │
        ▼
Permanent Root Filesystem
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--6"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--7"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The temporary root exists only to make the permanent root accessible.

Once the permanent root is ready, the temporary one is discarded.

---

## Engineering Insight

Many engineers assume that the `/` directory they see after logging in has existed since the kernel started.

In reality, the first `/` belongs to the initrd environment. The root filesystem you interact with after the system boots is a completely different filesystem that replaces the temporary one through the `switch_root` process.

Understanding this transition makes it much easier to troubleshoot early boot failures.

---

# The Virtual Filesystem (VFS)

Before mounting any filesystem, Linux uses an abstraction layer called the **Virtual Filesystem (VFS)**.

The VFS allows the kernel to interact with different filesystem types through a common interface.

Whether the underlying filesystem is:

- ext4
- XFS
- Btrfs
- ext3
- ext2

the kernel uses the same internal API.

A simplified architecture looks like this:

```
Applications
      │
      ▼
Virtual Filesystem (VFS)
      │
      ├───────────────┬───────────────┬───────────────┐
      ▼               ▼               ▼
    ext4             XFS            Btrfs
      │               │               │
      ▼               ▼               ▼
   Storage Device   Storage Device  Storage Device
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--10"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--11"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This abstraction allows Linux to support many filesystem types without requiring applications to know which one is in use.

---

# Finding the Root Filesystem

At this point, the initrd environment has already activated storage devices such as:

- LVM
- RAID
- Multipath
- SAN
- NVMe

The kernel now attempts to locate the root filesystem specified by the kernel command line.

For example:

```
root=/dev/sda2
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--13"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--14"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
root=/dev/mapper/vg_root-lv_root
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--15"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--16"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
root=UUID=31fd66b5-dfd6-4d96-9c65-aab7c6d79e5d
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--17"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--18"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The kernel resolves this parameter to an actual block device.

If the device exists and the required filesystem driver is available, the filesystem can be mounted.

---

# Why UUID Is Preferred

Modern Linux systems usually avoid using device names such as:

```
/dev/sda1
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--20"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--21"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Instead they use:

```
UUID=31fd66b5-dfd6-4d96-9c65-aab7c6d79e5d
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--22"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--23"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
LABEL=rootfs
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--24"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--25"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Why?

Because device names are not guaranteed to remain consistent.

Adding another disk may change:

```
/dev/sda
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--26"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--27"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>into

```
/dev/sdb
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--28"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--29"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>which could prevent the system from booting.

UUIDs remain stable regardless of device ordering.

---

# Mounting the Filesystem

Once the root device has been located, Linux mounts it.

Initially, many distributions mount the filesystem as:

```
read-only
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--31"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--32"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This allows the kernel to perform consistency checks before permitting write operations.

Later during the boot process, it is remounted as:

```
read-write
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--33"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--34"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This transition often occurs before system services begin starting.

---

# The switch\_root Operation

After the root filesystem has been mounted successfully, Linux reaches another critical milestone.

The temporary initrd environment has fulfilled its purpose.

Execution must now continue from the real operating system.

This transition is performed by:

```
switch_root
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--36"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--37"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The sequence looks like this:

```
Kernel
      │
      ▼
Temporary Root
      │
      ▼
Mount Real Root
      │
      ▼
switch_root
      │
      ▼
Execute /sbin/init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--38"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--39"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>The `switch_root` operation replaces the temporary root filesystem with the permanent one.

From this point onward:

- `/etc`
- `/usr`
- `/var`
- `/home`
- `/bin`

all come from the real operating system installed on disk.

The initrd environment disappears completely.

---

# What Happens If Mounting Fails?

Failure at this stage is one of the most common causes of boot problems.

Typical reasons include:

- Incorrect `root=` parameter.
- Missing filesystem driver.
- Corrupted filesystem.
- Inactive LVM volume.
- Missing RAID device.
- Damaged storage.
- Incorrect UUID.

Depending on the failure, the system may display messages such as:

```
VFS: Cannot open root device
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--41"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--42"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Kernel panic - not syncing:
VFS: Unable to mount root fs
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--43"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--44"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
Waiting for root device...
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--45"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--46"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Although these messages mention the kernel, the underlying issue is frequently related to storage discovery rather than a defect in the kernel itself.

---

## Engineering Insight

One of the easiest mistakes to make during recovery is focusing only on the final error message.

For example, if the system reports **"Unable to mount root filesystem"**, it is tempting to assume the filesystem is corrupted.

However, the filesystem may never have been reached.

The real issue could be:

- the LVM volume was never activated,
- the RAID array was incomplete,
- the storage driver was missing,
- or the kernel was looking for the wrong root device.

Always verify that the expected block device actually exists before attempting filesystem repair.

---

# Verifying the Root Device

During recovery or rescue mode, several commands can help confirm that the expected root device is available.

```
lsblk
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--49"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--50"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Displays the hierarchy of block devices and mounted filesystems.

```
blkid
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--51"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--52"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Shows UUIDs and filesystem types.

```
cat /proc/cmdline
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--53"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--54"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Displays the kernel command line, including the `root=` parameter used during boot.

```
mount
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--55"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--56"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Shows which filesystems are currently mounted.

```
cat /proc/mounts
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--57"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--58"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Lists active mount points from the kernel's perspective.

These commands are often the first step when investigating boot issues involving storage or root filesystem discovery.

---

# Summary

The goal of the previous stages was never simply to start the kernel—it was to make the real root filesystem available.

Once the root filesystem has been mounted, Linux leaves the temporary initrd environment behind and transitions to the permanent operating system through `switch_root`.

From this moment onward, the kernel can begin executing programs stored on the real filesystem, starting with the very first userspace process.

This process, known as **PID 1**, is responsible for initializing the rest of the operating system and will be the focus of the next stage.

# IEN-007 - Stage 6 — PID 1: The Beginning of User Space

At the end of the previous stage, the Linux kernel has successfully mounted the real root filesystem.

The temporary initrd environment has completed its job and has been discarded through the `switch_root` operation.

For the first time since the system was powered on, the kernel has access to the complete operating system installed on disk.

Yet one question remains:

> **Who starts everything else?**

The kernel is responsible for managing hardware, memory, scheduling, and system calls, but it does not start services, launch user sessions, or manage applications directly.

Instead, it hands control to the first userspace process.

That process is known as **PID 1**.

Everything that happens after this point ultimately begins with PID 1.

---

# What Is PID 1?

In Linux, every running program is represented as a **process**.

Each process receives a unique **Process ID (PID)** assigned by the kernel.

For example:

<div class="TyagGW_tableContainer" id="bkmrk-pid-process-1-init-o"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="1393" data-start="1269"><thead data-end="1286" data-start="1269"><tr data-end="1286" data-start="1269"><th class="last:pe-10" data-col-size="sm" data-end="1275" data-start="1269">PID</th><th class="last:pe-10" data-col-size="sm" data-end="1286" data-start="1275">Process</th></tr></thead><tbody data-end="1393" data-start="1305"><tr data-end="1328" data-start="1305"><td data-col-size="sm" data-end="1309" data-start="1305">1</td><td data-col-size="sm" data-end="1328" data-start="1309">init or systemd</td></tr><tr data-end="1343" data-start="1329"><td data-col-size="sm" data-end="1335" data-start="1329">247</td><td data-col-size="sm" data-end="1343" data-start="1335">sshd</td></tr><tr data-end="1359" data-start="1344"><td data-col-size="sm" data-end="1350" data-start="1344">831</td><td data-col-size="sm" data-end="1359" data-start="1350">nginx</td></tr><tr data-end="1377" data-start="1360"><td data-col-size="sm" data-end="1367" data-start="1360">1524</td><td data-col-size="sm" data-end="1377" data-start="1367">mysqld</td></tr><tr data-end="1393" data-start="1378"><td data-col-size="sm" data-end="1385" data-start="1378">2765</td><td data-col-size="sm" data-end="1393" data-start="1385">bash</td></tr></tbody></table>

</div></div>The very first process created by the kernel is always assigned:

```
PID = 1
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--1"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--2"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>No exceptions.

This process becomes the **ancestor of almost every other userspace process** running on the system.

---

# The Transition from Kernel Space to User Space

Until now, everything has been executed in **kernel space**.

This includes:

- Memory management
- Interrupt handling
- Driver initialization
- Storage discovery
- Root filesystem mounting

Applications do not run here.

Instead, once the kernel has finished its initialization, it starts the first userspace program.

The transition looks like this:

```
Kernel Space
      │
      ▼
Execute PID 1
      │
      ▼
User Space Begins
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--4"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--5"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This is one of the most important transitions during the entire boot sequence.

---

# How Does the Kernel Find PID 1?

The kernel looks for a userspace initialization program in a predefined order.

Traditionally, it searches for:

```
/sbin/init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--7"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--8"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>If that does not exist, it may try:

```
/etc/init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--9"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--10"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
/bin/init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--11"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--12"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
/bin/sh
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--13"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--14"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>If none of these programs can be executed, the kernel has nowhere to transfer control.

The result is typically a panic similar to:

```
Kernel panic - not syncing:
No working init found.
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--15"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--16"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This is one of the few kernel panic messages where the kernel itself is functioning correctly, but it cannot continue because the first userspace program is missing or unusable.

---

## Engineering Insight

Many administrators immediately suspect a damaged kernel when they see a kernel panic.

However, in the case of **"No working init found"**, the kernel has already completed most of its initialization successfully.

The actual problem is that it cannot execute the first userspace process.

Replacing the kernel would not solve the issue if `/sbin/init` is missing or the root filesystem is corrupted.

---

# The Evolution of Linux Initialization Systems

The role of PID 1 has remained the same throughout Linux history, but the software implementing it has evolved significantly.

### SysV init

For many years, Linux systems used **System V init**.

This implementation was simple and relied on shell scripts.

The boot process followed a sequence similar to:

```
Kernel
    │
    ▼
/sbin/init
    │
    ▼
Runlevel Scripts
    │
    ▼
System Services
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--19"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--20"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Service startup was largely sequential, meaning each service waited for the previous one to complete.

---

### Upstart

As Linux systems became more dynamic, **Upstart** introduced an event-driven model.

Instead of relying solely on predefined runlevels, services could start in response to events such as:

- Filesystem mounted
- Network available
- Device detected

Although innovative, Upstart was eventually replaced by systemd in most major distributions.

---

### systemd

Today, the majority of Linux distributions use **systemd** as PID 1.

Unlike earlier initialization systems, systemd introduces:

- Parallel service startup
- Dependency management
- Socket activation
- Service supervision
- Integrated logging (journal)
- Timers
- Mount unit management
- Target-based booting

A simplified flow looks like this:

```
Kernel
    │
    ▼
systemd (PID 1)
    │
    ├────────────┬─────────────┬─────────────┐
    ▼            ▼             ▼
Networking    Logging      Device Manager
    │            │             │
    └────────────┴─────────────┘
                 │
                 ▼
         Remaining Services
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--23"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--24"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>This architecture enables modern Linux systems to boot faster and manage services more efficiently than traditional SysV init.

---

# Runlevels vs Targets

Older Linux distributions, including RHEL 5, organize the boot process using **runlevels**.

Common runlevels include:

<div class="TyagGW_tableContainer" id="bkmrk-runlevel-purpose-0-h"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="5324" data-start="5151"><thead data-end="5173" data-start="5151"><tr data-end="5173" data-start="5151"><th class="last:pe-10" data-col-size="sm" data-end="5162" data-start="5151">Runlevel</th><th class="last:pe-10" data-col-size="sm" data-end="5173" data-start="5162">Purpose</th></tr></thead><tbody data-end="5324" data-start="5197"><tr data-end="5209" data-start="5197"><td data-col-size="sm" data-end="5201" data-start="5197">0</td><td data-col-size="sm" data-end="5209" data-start="5201">Halt</td></tr><tr data-end="5234" data-start="5210"><td data-col-size="sm" data-end="5214" data-start="5210">1</td><td data-col-size="sm" data-end="5234" data-start="5214">Single-user mode</td></tr><tr data-end="5265" data-start="5235"><td data-col-size="sm" data-end="5239" data-start="5235">3</td><td data-col-size="sm" data-end="5265" data-start="5239">Multi-user (text mode)</td></tr><tr data-end="5309" data-start="5266"><td data-col-size="sm" data-end="5270" data-start="5266">5</td><td data-col-size="sm" data-end="5309" data-start="5270">Multi-user with graphical interface</td></tr><tr data-end="5324" data-start="5310"><td data-col-size="sm" data-end="5314" data-start="5310">6</td><td data-col-size="sm" data-end="5324" data-start="5314">Reboot</td></tr></tbody></table>

</div></div>Modern distributions using systemd replace runlevels with **targets**.

For example:

<div class="TyagGW_tableContainer" id="bkmrk-sysv-runlevel-system"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="5554" data-start="5412"><thead data-end="5446" data-start="5412"><tr data-end="5446" data-start="5412"><th class="last:pe-10" data-col-size="sm" data-end="5428" data-start="5412">SysV Runlevel</th><th class="last:pe-10" data-col-size="sm" data-end="5446" data-start="5428">systemd Target</th></tr></thead><tbody data-end="5554" data-start="5482"><tr data-end="5503" data-start="5482"><td data-col-size="sm" data-end="5486" data-start="5482">1</td><td data-col-size="sm" data-end="5503" data-start="5486">rescue.target</td></tr><tr data-end="5529" data-start="5504"><td data-col-size="sm" data-end="5508" data-start="5504">3</td><td data-col-size="sm" data-end="5529" data-start="5508">multi-user.target</td></tr><tr data-end="5554" data-start="5530"><td data-col-size="sm" data-end="5534" data-start="5530">5</td><td data-col-size="sm" data-end="5554" data-start="5534">graphical.target</td></tr></tbody></table>

</div></div>Although the terminology differs, the underlying goal is the same: define the desired operating state of the system.

---

# The Importance of PID 1

PID 1 has several unique responsibilities that no other process performs.

These include:

- Starting essential system services.
- Managing service dependencies.
- Reaping orphaned child processes.
- Coordinating system shutdown and reboot.
- Handling service failures.

Because of these responsibilities, PID 1 is special.

If a normal process crashes, only that application is affected.

If PID 1 exits unexpectedly, the operating system can no longer manage its processes correctly.

Historically, this often resulted in a kernel panic or an unusable system.

---

## Engineering Insight

PID 1 is more than "the first process."

It acts as the **orchestrator** of the entire userspace environment.

Every service you rely on—networking, SSH, databases, logging, web servers—ultimately exists because PID 1 started or supervised it.

Understanding this role helps explain why issues affecting `init` or `systemd` can have system-wide consequences.

---

# Common PID 1 Failures

Although failures at this stage are less common than storage-related issues, they can still occur.

<div class="TyagGW_tableContainer" id="bkmrk-symptom-likely-cause"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="7137" data-start="6788"><thead data-end="6814" data-start="6788"><tr data-end="6814" data-start="6788"><th class="last:pe-10" data-col-size="sm" data-end="6798" data-start="6788">Symptom</th><th class="last:pe-10" data-col-size="md" data-end="6814" data-start="6798">Likely Cause</th></tr></thead><tbody data-end="7137" data-start="6842"><tr data-end="6905" data-start="6842"><td data-col-size="sm" data-end="6868" data-start="6842">`No working init found`</td><td data-col-size="md" data-end="6905" data-start="6868">Missing or corrupted `/sbin/init`</td></tr><tr data-end="6962" data-start="6906"><td data-col-size="sm" data-end="6945" data-start="6906">Immediate reboot after mounting root</td><td data-col-size="md" data-end="6962" data-start="6945">PID 1 crashed</td></tr><tr data-end="7055" data-start="6963"><td data-col-size="sm" data-end="7001" data-start="6963">Rescue shell instead of normal boot</td><td data-col-size="md" data-end="7055" data-start="7001">Essential services failed or rescue target entered</td></tr><tr data-end="7137" data-start="7056"><td data-col-size="sm" data-end="7092" data-start="7056">system hangs after switching root</td><td data-col-size="md" data-end="7137" data-start="7092">Initialization process could not continue</td></tr></tbody></table>

</div></div>When troubleshooting, it is important to distinguish between:

- **The kernel failing to start PID 1**, and
- **PID 1 starting successfully but encountering problems later while launching services.**

The second scenario belongs to the next stage of the boot process.

---

# Verifying PID 1

On a running system, confirming the identity of PID 1 is straightforward.

```
ps -p 1
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--30"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--31"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Example output:

```
PID TTY          TIME CMD
1 ?        00:00:05 systemd
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--32"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--33"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or on legacy systems:

```
PID TTY          TIME CMD
1 ?        00:00:01 init
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--34"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--35"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>You can also inspect the executable directly:

```
ls -l /proc/1/exe
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--36"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--37"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>This symbolic link reveals the actual program running as PID 1.

---

# Summary

The execution of PID 1 marks the beginning of **userspace**.

Until this point, Linux has been concerned primarily with preparing hardware and mounting the operating system.

Now the focus shifts to bringing the operating system to life.

Whether implemented as SysV init, Upstart, or systemd, PID 1 serves as the parent of nearly every userspace process and coordinates the initialization of the entire system.

Without it, Linux cannot progress beyond a mounted root filesystem into a fully operational environment.

# IEN-008 - Stage 7 — System Service Initialization

At the end of the previous stage, the Linux kernel has successfully transferred control to PID 1.

Whether PID 1 is implemented as **SysV init**, **Upstart**, or **systemd**, the operating system has now entered the userspace initialization phase.

For the first time since the power button was pressed, Linux is no longer focused on preparing itself to boot.

Instead, it begins preparing itself to **serve users and applications**.

This stage is responsible for transforming a mounted filesystem into a fully operational operating system.

---

# What Is a System Service?

A Linux system consists of much more than the kernel.

Even after the kernel has initialized hardware and mounted the root filesystem, the system still lacks many essential capabilities.

For example:

- Networking is not yet configured.
- Remote SSH access is unavailable.
- System logs are not being collected.
- Scheduled tasks are inactive.
- Time synchronization has not started.
- Firewalls may not yet be enforced.
- Databases and web servers are still offline.

These capabilities are provided by **system services**, also known as **daemons**.

A daemon is simply a process that runs in the background and performs a specific function.

Examples include:

<div class="TyagGW_tableContainer" id="bkmrk-service-purpose-sshd"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="1977" data-start="1663"><thead data-end="1684" data-start="1663"><tr data-end="1684" data-start="1663"><th class="last:pe-10" data-col-size="sm" data-end="1673" data-start="1663">Service</th><th class="last:pe-10" data-col-size="sm" data-end="1684" data-start="1673">Purpose</th></tr></thead><tbody data-end="1977" data-start="1707"><tr data-end="1737" data-start="1707"><td data-col-size="sm" data-end="1716" data-start="1707">`sshd`</td><td data-col-size="sm" data-end="1737" data-start="1716">Remote SSH access</td></tr><tr data-end="1782" data-start="1738"><td data-col-size="sm" data-end="1757" data-start="1738">`NetworkManager`</td><td data-col-size="sm" data-end="1782" data-start="1757">Network configuration</td></tr><tr data-end="1822" data-start="1783"><td data-col-size="sm" data-end="1804" data-start="1783">`systemd-journald`</td><td data-col-size="sm" data-end="1822" data-start="1804">System logging</td></tr><tr data-end="1859" data-start="1823"><td data-col-size="sm" data-end="1835" data-start="1823">`chronyd`</td><td data-col-size="sm" data-end="1859" data-start="1835">Time synchronization</td></tr><tr data-end="1898" data-start="1860"><td data-col-size="sm" data-end="1870" data-start="1860">`crond`</td><td data-col-size="sm" data-end="1898" data-start="1870">Scheduled task execution</td></tr><tr data-end="1936" data-start="1899"><td data-col-size="sm" data-end="1913" data-start="1899">`firewalld`</td><td data-col-size="sm" data-end="1936" data-start="1913">Firewall management</td></tr><tr data-end="1977" data-start="1937"><td data-col-size="sm" data-end="1946" data-start="1937">`dbus`</td><td data-col-size="sm" data-end="1977" data-start="1946">Inter-process communication</td></tr></tbody></table>

</div></div>Without these services, Linux would boot successfully but remain largely unusable in a production environment.

---

# From PID 1 to Running Services

The initialization sequence now looks like this:

```
Kernel
    │
    ▼
PID 1 (systemd/init)
    │
    ▼
Load Unit Files / Init Scripts
    │
    ▼
Resolve Dependencies
    │
    ▼
Start Core Services
    │
    ▼
Start Optional Services
    │
    ▼
Reach Target State
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--2"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--3"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Each step builds upon the previous one.

Unlike the firmware and kernel stages, this phase is highly configurable.

Administrators can decide:

- Which services start automatically.
- The order in which they start.
- Whether a failure should stop the boot process.
- Whether a service should restart automatically.

---

# Service Dependencies

Modern Linux systems rarely start services in a fixed order.

Instead, they rely on **dependencies**.

Consider an SSH server.

It cannot accept remote connections until:

- the network interface exists,
- IP addresses are configured,
- the firewall is initialized,
- DNS (if required) is available.

The dependency graph looks something like this:

```
Hardware Ready
      │
      ▼
udev
      │
      ▼
Network Stack
      │
      ▼
IP Configuration
      │
      ▼
Firewall
      │
      ▼
SSH Server
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--5"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--6"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>If one dependency fails, downstream services may also fail or wait indefinitely.

---

## Engineering Insight

A common misunderstanding is that Linux starts services one by one in a hard-coded sequence.

Modern systems using **systemd** actually construct a dependency graph and start many services in parallel whenever possible.

This approach significantly reduces boot time while ensuring that dependent services do not start before their prerequisites are satisfied.

---

# systemd Units

Unlike SysV init, which relied primarily on shell scripts, systemd manages resources using **unit files**.

Common unit types include:

<div class="TyagGW_tableContainer" id="bkmrk-unit-type-purpose-.s"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="4237" data-start="3898"><thead data-end="3921" data-start="3898"><tr data-end="3921" data-start="3898"><th class="last:pe-10" data-col-size="sm" data-end="3910" data-start="3898">Unit Type</th><th class="last:pe-10" data-col-size="sm" data-end="3921" data-start="3910">Purpose</th></tr></thead><tbody data-end="4237" data-start="3946"><tr data-end="3981" data-start="3946"><td data-col-size="sm" data-end="3959" data-start="3946">`.service`</td><td data-col-size="sm" data-end="3981" data-start="3959">Background service</td></tr><tr data-end="4015" data-start="3982"><td data-col-size="sm" data-end="3994" data-start="3982">`.socket`</td><td data-col-size="sm" data-end="4015" data-start="3994">Socket activation</td></tr><tr data-end="4051" data-start="4016"><td data-col-size="sm" data-end="4028" data-start="4016">`.target`</td><td data-col-size="sm" data-end="4051" data-start="4028">Logical boot target</td></tr><tr data-end="4083" data-start="4052"><td data-col-size="sm" data-end="4063" data-start="4052">`.mount`</td><td data-col-size="sm" data-end="4083" data-start="4063">Filesystem mount</td></tr><tr data-end="4132" data-start="4084"><td data-col-size="sm" data-end="4099" data-start="4084">`.automount`</td><td data-col-size="sm" data-end="4132" data-start="4099">Automatic filesystem mounting</td></tr><tr data-end="4162" data-start="4133"><td data-col-size="sm" data-end="4144" data-start="4133">`.timer`</td><td data-col-size="sm" data-end="4162" data-start="4144">Scheduled task</td></tr><tr data-end="4194" data-start="4163"><td data-col-size="sm" data-end="4175" data-start="4163">`.device`</td><td data-col-size="sm" data-end="4194" data-start="4175">Hardware device</td></tr><tr data-end="4237" data-start="4195"><td data-col-size="sm" data-end="4205" data-start="4195">`.path`</td><td data-col-size="sm" data-end="4237" data-start="4205">File or directory monitoring</td></tr></tbody></table>

</div></div>This modular design allows systemd to manage far more than just services.

For example, mounting a filesystem or waiting for a hardware device can be handled through dedicated unit types rather than custom scripts.

---

# Reaching the Target State

One of systemd's primary goals is to bring the system to a predefined **target**.

Common targets include:

<div class="TyagGW_tableContainer" id="bkmrk-target-purpose-rescu"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="4844" data-start="4597"><thead data-end="4617" data-start="4597"><tr data-end="4617" data-start="4597"><th class="last:pe-10" data-col-size="sm" data-end="4606" data-start="4597">Target</th><th class="last:pe-10" data-col-size="sm" data-end="4617" data-start="4606">Purpose</th></tr></thead><tbody data-end="4844" data-start="4639"><tr data-end="4686" data-start="4639"><td data-col-size="sm" data-end="4657" data-start="4639">`rescue.target`</td><td data-col-size="sm" data-end="4686" data-start="4657">Single-user recovery mode</td></tr><tr data-end="4740" data-start="4687"><td data-col-size="sm" data-end="4709" data-start="4687">`multi-user.target`</td><td data-col-size="sm" data-end="4740" data-start="4709">Multi-user text environment</td></tr><tr data-end="4795" data-start="4741"><td data-col-size="sm" data-end="4762" data-start="4741">`graphical.target`</td><td data-col-size="sm" data-end="4795" data-start="4762">Graphical desktop environment</td></tr><tr data-end="4844" data-start="4796"><td data-col-size="sm" data-end="4817" data-start="4796">`emergency.target`</td><td data-col-size="sm" data-end="4844" data-start="4817">Minimal emergency shell</td></tr></tbody></table>

</div></div>Most production servers aim to reach:

```
multi-user.target
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--10"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--11"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>while desktop systems typically boot into:

```
graphical.target
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--12"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--13"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Once the target is reached, Linux is considered operational.

---

# Parallel Startup

One of the most significant innovations introduced by systemd is **parallel service startup**.

Older SysV init systems generally followed a linear process:

```
Service A
    │
    ▼
Service B
    │
    ▼
Service C
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--15"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--16"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>If one service took ten seconds to start, every subsequent service had to wait.

Systemd instead starts independent services simultaneously:

```
               systemd
          ┌──────┼──────┐
          ▼      ▼      ▼
      Logging  Network  Cron
          │      │
          ▼      ▼
       SSH      NTP
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--17"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--18"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>As long as dependency requirements are met, multiple services can initialize concurrently, reducing overall boot time.

---

# Service Failures During Boot

Not every service failure prevents Linux from booting.

For example, if a monitoring agent fails to start, the operating system can usually continue running.

However, failures involving critical services may leave the system in a degraded state.

Examples include:

- Network initialization failure.
- Storage mount failure.
- Authentication service failure.
- Device manager failure.
- Logging subsystem failure.

Systemd records these failures and provides detailed diagnostic information for later analysis.

---

# Investigating Boot Problems

One of systemd's greatest strengths is its diagnostic capabilities.

Several commands are particularly useful when troubleshooting service initialization issues.

```
systemctl --failed
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--21"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--22"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Lists services that failed during startup.

```
systemctl status <service>
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--23"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--24"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Displays the status, recent log entries, and dependency information for a specific service.

```
journalctl -b
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--25"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--26"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Shows all log messages generated since the current boot.

```
journalctl -u sshd
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--27"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--28"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Displays logs related to the SSH service.

```
systemd-analyze
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--29"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--30"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>Reports the total boot time.

Example:

```
Startup finished in 2.432s (kernel)
               + 8.917s (userspace)
               = 11.349s
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--31"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--32"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>For deeper analysis:

```
systemd-analyze blame
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--33"><div class=""><div class="contents"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="relative h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class=""><div class="relative"><div class=""><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--34"><div class="cm-scroller"></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div></div></div>lists services sorted by startup duration, helping identify bottlenecks.

---

## Engineering Insight

When a Linux system appears to "boot slowly," the kernel is often blamed.

In reality, the kernel typically completes its work within a few seconds. Delays are more commonly caused by userspace services waiting for storage devices, network configuration, DNS resolution, or external resources.

Tools such as `systemd-analyze blame` and `journalctl -b` are often far more useful than focusing solely on kernel messages.

---

# Common Service Initialization Failures

The table below summarizes several common issues encountered during this stage.

<div class="TyagGW_tableContainer" id="bkmrk-symptom-possible-cau"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="8089" data-start="7745"><thead data-end="7773" data-start="7745"><tr data-end="7773" data-start="7745"><th class="last:pe-10" data-col-size="sm" data-end="7755" data-start="7745">Symptom</th><th class="last:pe-10" data-col-size="sm" data-end="7773" data-start="7755">Possible Cause</th></tr></thead><tbody data-end="8089" data-start="7803"><tr data-end="7851" data-start="7803"><td data-col-size="sm" data-end="7825" data-start="7803">Network unavailable</td><td data-col-size="sm" data-end="7851" data-start="7825">Network service failed</td></tr><tr data-end="7901" data-start="7852"><td data-col-size="sm" data-end="7877" data-start="7852">SSH connection refused</td><td data-col-size="sm" data-end="7901" data-start="7877">`sshd` did not start</td></tr><tr data-end="7967" data-start="7902"><td data-col-size="sm" data-end="7935" data-start="7902">Boot stops waiting for a mount</td><td data-col-size="sm" data-end="7967" data-start="7935">Filesystem dependency failed</td></tr><tr data-end="8036" data-start="7968"><td data-col-size="sm" data-end="7999" data-start="7968">System enters emergency mode</td><td data-col-size="sm" data-end="8036" data-start="7999">Critical mount or service failure</td></tr><tr data-end="8089" data-start="8037"><td data-col-size="sm" data-end="8054" data-start="8037">Long boot time</td><td data-col-size="sm" data-end="8089" data-start="8054">Slow or blocked service startup</td></tr></tbody></table>

</div></div>Unlike earlier stages, these failures occur **after the operating system has already mounted the root filesystem and started PID 1**.

This distinction helps narrow the investigation to userspace rather than firmware, bootloader, or kernel components.

---

# Summary

The service initialization stage transforms Linux from a mounted operating system into a fully functional platform capable of supporting users and applications.

PID 1 launches essential services, resolves dependencies, manages failures, and brings the system to its configured operational target.

While earlier boot stages focus on hardware and storage, this stage focuses on functionality—networking, logging, scheduling, security, and every background process required for normal operation.

By the time the target state is reached, Linux is ready to present a login interface and begin accepting user sessions.

# IEN-009 - Stage 8 — User Login: Entering User Space

At this point, the Linux system has completed nearly all of its startup sequence.

The firmware initialized the hardware.

The bootloader loaded the Linux kernel.

The kernel initialized the operating system.

The initrd environment prepared storage.

The root filesystem was mounted.

PID 1 started.

System services were initialized.

Now Linux performs its final task before becoming fully operational:

> **Provide a way for users and applications to interact with the system.**

Depending on the system configuration, this interaction may occur through:

- A local text console
- A graphical desktop
- A serial console
- An SSH connection
- A virtual machine console

Regardless of the access method, they all originate from the same initialization process that began with PID 1.

---

# From Services to User Sessions

The simplified boot sequence now looks like this:

```
Firmware
      │
      ▼
Bootloader
      │
      ▼
Kernel
      │
      ▼
initrd
      │
      ▼
Root Filesystem
      │
      ▼
PID 1
      │
      ▼
System Services
      │
      ▼
Login Manager
      │
      ▼
User Authentication
      │
      ▼
Shell / Desktop
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--1"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--2"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Notice that the operating system itself is already running before any user logs in.

Logging in does **not** start Linux.

It merely creates a new user session on an already running operating system.

---

# Text-Based Login

Most Linux servers operate without a graphical interface.

Instead, they provide one or more virtual terminals (TTYs).

Each virtual terminal is managed by a program called **getty**.

Its responsibilities include:

- Displaying the login prompt.
- Reading the username.
- Invoking the authentication process.
- Launching the user's shell after successful authentication.

The familiar prompt:

```
server login:
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--4"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--5"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>is typically provided by a `getty` process.

Once a valid username and password are entered, the authentication subsystem verifies the credentials.

If authentication succeeds, the user's default shell is started.

For example:

```
/bin/bash
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--6"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--7"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or

```
/bin/zsh
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--8"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--9"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>From this point onward, the user is interacting directly with the operating system.

---

# Graphical Login

Desktop Linux systems follow a similar process but use a **Display Manager** instead of a text console.

Common display managers include:

<div class="TyagGW_tableContainer" id="bkmrk-display-manager-desk"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="2847" data-start="2675"><thead data-end="2716" data-start="2675"><tr data-end="2716" data-start="2675"><th class="last:pe-10" data-col-size="sm" data-end="2693" data-start="2675">Display Manager</th><th class="last:pe-10" data-col-size="sm" data-end="2716" data-start="2693">Desktop Environment</th></tr></thead><tbody data-end="2847" data-start="2759"><tr data-end="2774" data-start="2759"><td data-col-size="sm" data-end="2765" data-start="2759">GDM</td><td data-col-size="sm" data-end="2774" data-start="2765">GNOME</td></tr><tr data-end="2796" data-start="2775"><td data-col-size="sm" data-end="2782" data-start="2775">SDDM</td><td data-col-size="sm" data-end="2796" data-start="2782">KDE Plasma</td></tr><tr data-end="2831" data-start="2797"><td data-col-size="sm" data-end="2807" data-start="2797">LightDM</td><td data-col-size="sm" data-end="2831" data-start="2807">XFCE, MATE, Cinnamon</td></tr><tr data-end="2847" data-start="2832"><td data-col-size="sm" data-end="2839" data-start="2832">LXDM</td><td data-col-size="sm" data-end="2847" data-start="2839">LXDE</td></tr></tbody></table>

</div></div>Instead of displaying:

```
login:
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--11"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--12"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>the display manager presents a graphical login screen.

After successful authentication, it starts:

- the graphical session,
- the desktop environment,
- and user applications.

Although the interface looks very different, the underlying boot sequence remains the same.

---

# Remote Login (SSH)

In enterprise environments, users rarely log in through the physical console.

Instead, they connect remotely using SSH.

The sequence is:

```
Client
     │
     ▼
Network
     │
     ▼
sshd
     │
     ▼
Authentication
     │
     ▼
Shell
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--14"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--15"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Notice something important.

SSH is **not** part of the boot process itself.

It depends on:

- networking,
- systemd,
- sshd,
- authentication services,

all of which must already be operational.

If the SSH daemon fails to start, Linux may have booted successfully even though remote administrators cannot access it.

---

## Engineering Insight

One of the most common production incidents is:

> "The server is down because SSH doesn't work."

In reality, the operating system may be fully operational.

The actual problem could be:

- `sshd` failed to start,
- the network interface was not configured,
- firewall rules block port 22,
- DNS resolution failed,
- or the authentication service is unavailable.

Always distinguish between:

> **"Linux failed to boot."**

and

> **"Linux booted successfully, but one service failed."**

These are fundamentally different classes of problems.

---

# User Session Initialization

After authentication succeeds, Linux prepares the user's environment.

Typical initialization steps include:

- Setting environment variables.
- Determining the user's home directory.
- Loading shell configuration files.
- Applying resource limits.
- Starting the user's login shell.

For Bash users, configuration files often include:

```
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--18"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--19"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>These files customize the user's working environment before the shell prompt appears.

---

# The Linux Boot Process Is Complete

Once the user receives a shell prompt or graphical desktop, the boot process is considered complete.

For a server, this often looks like:

```
login:
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--21"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--22"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>or after authentication:

```
[root@server ~]#
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--23"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--24"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>For desktop systems, it is the appearance of the desktop environment.

At this stage:

- The kernel is running.
- System services are active.
- Storage is mounted.
- Networking is operational.
- Users can execute applications.

The operating system is now fully functional.

---

# Complete Linux Boot Timeline

Now that we have explored each stage individually, let's review the entire process from beginning to end.

```
Power Button
      │
      ▼
Power Supply Initialization
      │
      ▼
CPU Reset
      │
      ▼
Firmware (BIOS / UEFI)
      │
      ▼
POST (Power-On Self-Test)
      │
      ▼
Boot Device Selection
      │
      ▼
Bootloader (GRUB)
      │
      ▼
Load Linux Kernel
      │
      ▼
Load initrd / initramfs
      │
      ▼
Kernel Initialization
      │
      ▼
Hardware Discovery
      │
      ▼
Load Drivers
      │
      ▼
Activate Storage (LVM / RAID / Multipath)
      │
      ▼
Mount Root Filesystem
      │
      ▼
switch_root
      │
      ▼
Execute PID 1
      │
      ▼
Initialize System Services
      │
      ▼
Login Manager
      │
      ▼
User Login
      │
      ▼
Shell / Desktop
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--26"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--27"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>One of the most important lessons from this timeline is that every stage depends on the successful completion of the previous one.

A failure early in the sequence prevents all later stages from occurring.

---

# Boot Troubleshooting Matrix

The table below summarizes the most common failures according to the stage in which they occur.

<div class="TyagGW_tableContainer" id="bkmrk-stage-component-typi"><div class="group TyagGW_tableWrapper flex flex-col-reverse w-fit" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="7394" data-start="6603"><thead data-end="6664" data-start="6603"><tr data-end="6664" data-start="6603"><th class="last:pe-10" data-col-size="sm" data-end="6611" data-start="6603">Stage</th><th class="last:pe-10" data-col-size="sm" data-end="6623" data-start="6611">Component</th><th class="last:pe-10" data-col-size="sm" data-end="6639" data-start="6623">Typical Error</th><th class="last:pe-10" data-col-size="sm" data-end="6664" data-start="6639">Primary Investigation</th></tr></thead><tbody data-end="7394" data-start="6726"><tr data-end="6805" data-start="6726"><td data-col-size="sm" data-end="6737" data-start="6726">Firmware</td><td data-col-size="sm" data-end="6751" data-start="6737">BIOS / UEFI</td><td data-col-size="sm" data-end="6768" data-start="6751">No Boot Device</td><td data-col-size="sm" data-end="6805" data-start="6768">Firmware settings, disk detection</td></tr><tr data-end="6875" data-start="6806"><td data-col-size="sm" data-end="6819" data-start="6806">Bootloader</td><td data-col-size="sm" data-end="6826" data-start="6819">GRUB</td><td data-col-size="sm" data-end="6843" data-start="6826">`grub rescue>`</td><td data-col-size="sm" data-end="6875" data-start="6843">GRUB configuration, MBR, EFI</td></tr><tr data-end="6952" data-start="6876"><td data-col-size="sm" data-end="6885" data-start="6876">Kernel</td><td data-col-size="sm" data-end="6900" data-start="6885">Linux Kernel</td><td data-col-size="sm" data-end="6915" data-start="6900">Kernel Panic</td><td data-col-size="sm" data-end="6952" data-start="6915">Kernel image, parameters, drivers</td></tr><tr data-end="7067" data-start="6953"><td data-col-size="sm" data-end="6971" data-start="6953">Early Userspace</td><td data-col-size="sm" data-end="6992" data-start="6971">initrd / initramfs</td><td data-col-size="sm" data-end="7026" data-start="6992">Unable to mount root filesystem</td><td data-col-size="sm" data-end="7067" data-start="7026">Storage drivers, LVM, RAID, Multipath</td></tr><tr data-end="7148" data-start="7068"><td data-col-size="sm" data-end="7086" data-start="7068">Root Filesystem</td><td data-col-size="sm" data-end="7092" data-start="7086">VFS</td><td data-col-size="sm" data-end="7112" data-start="7092">Cannot mount root</td><td data-col-size="sm" data-end="7148" data-start="7112">Filesystem, UUID, root parameter</td></tr><tr data-end="7233" data-start="7149"><td data-col-size="sm" data-end="7176" data-start="7149">Userspace Initialization</td><td data-col-size="sm" data-end="7184" data-start="7176">PID 1</td><td data-col-size="sm" data-end="7208" data-start="7184">No working init found</td><td data-col-size="sm" data-end="7233" data-start="7208">`/sbin/init`, systemd</td></tr><tr data-end="7316" data-start="7234"><td data-col-size="sm" data-end="7259" data-start="7234">Service Initialization</td><td data-col-size="sm" data-end="7269" data-start="7259">systemd</td><td data-col-size="sm" data-end="7287" data-start="7269">Failed services</td><td data-col-size="sm" data-end="7316" data-start="7287">`journalctl`, `systemctl`</td></tr><tr data-end="7394" data-start="7317"><td data-col-size="sm" data-end="7325" data-start="7317">Login</td><td data-col-size="sm" data-end="7339" data-start="7325">Getty / SSH</td><td data-col-size="sm" data-end="7359" data-start="7339">Login unavailable</td><td data-col-size="sm" data-end="7394" data-start="7359">Authentication, SSH, networking</td></tr></tbody></table>

</div></div>This matrix provides a practical way to map symptoms to the most likely stage of failure.

---

# Key Takeaways

Understanding the Linux boot process is not about memorizing commands.

It is about understanding the sequence of events that transforms powered hardware into a fully operational operating system.

Every boot stage has a clear responsibility:

- Firmware prepares the hardware.
- The bootloader loads the kernel.
- The kernel initializes the operating system.
- initrd prepares the storage stack.
- The root filesystem becomes accessible.
- PID 1 begins userspace.
- Services make the system functional.
- Login allows users to interact with the system.

When viewed individually, these components may seem unrelated.

When viewed together, they form a single, continuous chain.

Every boot problem—whether it is a missing bootloader, an incorrect kernel parameter, a failed LVM activation, or an unavailable login prompt—is simply a failure occurring somewhere along that chain.

Once you understand where the sequence stopped, you have already solved half of the troubleshooting process.

---

# Conclusion

Linux boot is often perceived as a mysterious sequence hidden behind a few lines of console output. In reality, it is a well-defined pipeline where each component has a specific responsibility and a clearly defined handoff to the next stage.

For infrastructure engineers, mastering this pipeline is invaluable. It enables faster troubleshooting, more confident disaster recovery, and a deeper understanding of how Linux systems behave under both normal and failure conditions.

The concepts introduced in this article serve as the foundation for the remainder of the *Infrastructure Engineering Notes* series. Future articles will revisit individual stages in greater depth, using real-world production incidents to illustrate how failures occur and how they can be resolved systematically.