AlgoViz

From power-on to a ready service

easy 7 min

Boot crosses ownership boundaries.

Video lesson · Chapter 1 of 8

A healthy kernel with a late application

0:00 / 5:40

Theory

Read or listen first. About 2 min.

What it is

Boot crosses ownership boundaries. Firmware locates a bootable image, a loader or firmware starts the kernel, and early userspace discovers the real root filesystem. PID 1 then activates units according to their ordering and requirement dependencies. Several units start in parallel, so summing unit durations can overstate the delay on the critical path.

Why it exists

After an image change new hosts pass their kernel heartbeat but miss the load balancer deadline. Align boot-relative timestamps on an old and a new host. A long wait for an optional remote mount can postpone the application even though the kernel is healthy. Check who actually requires the mount before changing the dependency.

If PID 1 never started, unit dependency timing cannot explain the failure. Move back to early console or root-mount evidence.

A healthy kernel with a late application

Firmware → Kernel and initramfs (start kernel). Kernel and initramfs → Service manager (start PID 1)
Firmware → Kernel and initramfs (start kernel). Kernel and initramfs → Service manager (start PID 1)

Inside this chapter

BIOS/UEFI and the POST sequence
Firmware initializes essential hardware, performs checks and selects a boot target. An application log cannot diagnose a host that never reached the operating system.
Bootloaders (GRUB)
A boot loader selects a kernel and passes its configuration and initial filesystem. A known-good boot entry gives operators a comparison after an image change.
Kernel Initialization (init)
The kernel initializes subsystems and devices before starting the first userspace process. PID 1 manages subsequent userspace initialization and has special process-reaping responsibilities.
initramfs and initrd
An initramfs supplies early userspace tools and drivers needed to find the real root. A device may be usable in the full image yet missing from early boot.
Kernel command line parameters
Boot parameters affect early behavior such as root device selection and console output. Compare the effective parameters from a working and failing boot before rebuilding an image.
Systemd architecture and targets
Systemd targets group units. Requirement and ordering edges serve separate purposes. A dependency can be required without specifying when its start job runs relative to another.
dmesg and the Kernel Ring Buffer
Kernel messages live in a bounded ring. Older entries can roll out. Boot identity and monotonic timestamps help connect a device message to the correct startup attempt.
Troubleshooting Kernel Panics and Boot failures
Localize the last successful transition using the console and previous boot journal. A failed root mount, an early panic and an application readiness failure require different recovery paths.

How it works

Step through the idea, or press Play.

Step 1 of 5

Load the kernel. Firmware or a boot loader loads the kernel and early filesystem.

Understand it

Worked incident

A healthy kernel with a late application

ObservationTime to readiness (s)Interpretation
Baseline18The root filesystem mounts and the app becomes ready after 18 seconds.
Incident94An optional mount now blocks the app behind a timeout.
After intervention21Decouple that optional dependency and verify a cold boot with the mount unavailable.
Illustrative measurements from the same workload at three checkpoints.

Choose the next investigation

If PID 1 never started, unit dependency timing cannot explain the failure. Move back to early console or root-mount evidence.

Summary

The whole topic in one minute.

The kernel already handed control to userspace. Unit ordering, mount timeouts and readiness timestamps distinguish the remaining delays.

If PID 1 never started, unit dependency timing cannot explain the failure. Move back to early console or root-mount evidence.

Sources