Skip to main content

Linux Boot Process: From Power-On to Login

Visualize the complete Linux boot sequence from BIOS/UEFI to login. Learn how GRUB, kernel, and systemd work together with interactive visualizations.

The Journey from Silicon to Shell

At power-on, there is no Linux process ready to run. Firmware must initialize enough hardware to load the next program. That program prepares the kernel, and the kernel establishes the environment in which user-space programs can start.

Think of boot as a series of handoffs. At each one, ask who has control, what has been loaded, and what the next stage needs. The examples here follow a conventional Linux PC using GRUB, an initramfs and systemd. Other boot arrangements are possible, including loading an EFI-stub kernel directly from firmware. Linux EFI boot stub.

Who hands control to whom?
Step 1 / 5
Prepare hardware and choose a boot entry.

Example total: 9 s · largest stage: Kernel + /init

Invented durations compare waits, not hardware. Playback uses equal-length teaching steps. Early userspace prepares the root; init and login are already userspace, and their services can overlap.

Exploring the Boot Sequence

The overview groups boot into firmware, bootloader, kernel and early userspace, host init, and login. These are useful teaching boundaries, not five universally timed intervals. A server may stop at a text login; a desktop normally starts a display manager as well.

Choose a stage to inspect its job and the evidence to look for when that handoff fails. Pay particular attention to early userspace: it can run before the installed root filesystem is available.

Explore each boot stage

Step 1 / 5

Prepare hardware and choose a boot entry

Receives

Reset

Passes on

Bootloader in memory

Where to investigate

Use firmware diagnostics, the boot menu and platform logs. A silent machine is not enough to identify a failed component.

What happens in this stage
  1. Begin at the processor’s reset entry.
  2. Perform platform-specific hardware checks.
  3. Initialize the devices needed to boot.
  4. Choose a boot entry or boot device.
  5. Load boot code: an EFI executable for UEFI, or a boot sector on a legacy BIOS path.
Five overview groups for a GRUB + initramfs + systemd example. Early userspace is shown with root preparation; Linux continues running underneath init and user sessions.

Step-by-Step Boot Walkthrough

Now follow the individual milestones. Watch which component is executing, which images have reached memory, and when the installed root filesystem becomes available. The walkthrough separates kernel initialization from the user-space program that prepares the root filesystem.

Follow the boot handoffs

Step 1 / 27

Power button pressed

Reset directs the CPU into platform firmware. No Linux code is running yet.

ExecutingFirmware
Current operationstart
Power / reset
Firmware entry

Images and root filesystem

Kernel in RAM
Not loaded
Initramfs
Not loaded
Root
Not mounted

Userspace process tree

PID 1 has not entered userspace

The kernel will start the initial userspace program.

Session: Not started

Milestone details and navigation
  • The reset entry and initial processor mode depend on the architecture.
  • This walkthrough follows one x86 UEFI boot with GRUB.
Illustrated x86 UEFI + GRUB + initramfs + systemd boot. The 27 milestones group related work; playback is not measured boot time. Other boot paths differ.

BIOS vs UEFI: Two Paths to Boot

Legacy PC BIOS boot typically begins by loading a disk boot sector. Its small bootstrap transfers control to further bootloader code. A UEFI boot manager instead selects an EFI executable, commonly from an EFI System Partition, and provides services that the loader can use before the kernel takes over.

Firmware and partition layout are related choices, but they are not the same thing. GRUB can support BIOS boot from GPT using a BIOS Boot Partition. The familiar approximately 2 TiB limit concerns conventional MBR partition addressing with 512-byte logical sectors, not an unconditional limit on every BIOS-booted disk. UEFI is also an interface spanning multiple processor architectures, rather than a synonym for 64-bit execution. GRUB BIOS installation, UEFI partition layouts.

Secure Boot is an additional UEFI policy for validating executable images. It is not automatically enabled on every UEFI machine, and its protection depends on which parts of the boot chain are authenticated. The Secure Boot section below follows that trust boundary separately from the loading path.

Two ways to find the next program

Step 1 / 6

Reset

The x86 CPU enters its reset state. UEFI firmware then establishes its execution environment.

Firmware

UEFI

Order

Boot disk

ESP
*.efi

Memory

Loader
Kernel
initramfs
What actually differs?
  • UEFI loads EFI applications through firmware protocols. Implementations exist for multiple architectures; the CPU does not reset directly into 64-bit long mode.
  • The ESP is a filesystem for boot applications. GPT is common, but partition layout and firmware interface are separate concepts. An EFI-stub Linux kernel can also boot without GRUB.
  • Secure Boot authorizes executable images when enabled. It does not imply that every file is verified or that every platform trusts the same keys.
Illustrated x86 disk boots with GRUB, not measured traces. Firmware implementations, storage layouts and security policies vary.

The Kernel's First Seconds

The loader places the kernel image, boot parameters and any external initramfs into memory. For a conventional compressed x86 kernel, early startup includes decompression and architecture-specific setup before the main kernel initialization path.

Memory management, scheduling, interrupt handling, core filesystems and device initialization establish the machinery needed to run processes. Their detailed ordering depends on the architecture and kernel version; they are not independent operations that can be rearranged freely. A driver may be built into the kernel or loaded later as a module.

The next important boundary is the first user-space program. The kernel creates the task that becomes PID 1 and executes the configured init program. If the early root contains /init, that program can prepare the installed system before the host service manager starts. Linux initramfs documentation.

The initramfs Chicken-and-Egg Problem

The root filesystem might require a storage driver, an unlocked encrypted volume, or a logical-volume setup. Those tools cannot be fetched from an inaccessible root filesystem. An initramfs supplies an initial user-space environment in memory so that this setup can happen first.

The kernel unpacks the archive. Its /init program then loads needed modules and finds or prepares the real root. Early userspace switches to that root and executes the host init program, retaining PID 1. This is a handoff between programs, not the creation of a second PID 1. Systems with all required support built in can use another boot arrangement without an external initramfs. Linux initramfs documentation.

For a closer look at the archive and root switch, continue to initramfs.

systemd: Parallel Service Orchestration

Once the host service manager runs, the problem changes from loading the operating system to starting its services. Many jobs can overlap; others must wait for prerequisites.

In systemd, ordering and activation are separate relationships. After= and Before= order jobs when both are present. Wants= and Requires= pull other units into a transaction, with different failure semantics; they do not by themselves impose a startup order. systemd.unit.

Targets group units into useful states. default.target commonly selects multi-user.target for a server or graphical.target for a desktop. This still permits parallel work: a display manager does not universally wait for every unrelated service to finish. systemd bootup.

Compare sequential and parallel schedules below. The jobs, durations and ordering edges form an authored example, not a recording of an installed machine or a benchmark of SysV Init against systemd. Follow the dependency arrows to see which work is actually blocking the next job.

Start independent work together

Step 1 / 10

Ready to start the jobs

Model time 0 ms · 0 / 9 complete. Select a job to trace prerequisite finishes to its start.

01300 ms
waitingrunningcomplete

gdm.service

Starts after Message bus and Network B finish. Scheduled for 700–1300 ms. Other ready jobs can start at the same time.

Ordering, activation and model totals

After= and Before= set ordering. Wants= and Requires= pull other units into a transaction; they do not set ordering by themselves. The example schedules every job successfully and omits socket activation, failures and resource contention.

example.service · illustrative ordering
[Unit]
Wants=example-data.service
After=example-data.service

Model completion: 2750 ms sequential, 1300 ms parallel. Actual boot performance needs measurement.

systemd unit ordering reference
Authored jobs, durations and ordering. This is a scheduling model, not a measured systemd/SysV comparison or a distribution’s dependency graph. Network A and B represent separately managed interfaces.

Comparing Boot Stages

A useful diagnosis starts with the last handoff that succeeded. A firmware boot-option failure, a kernel root-mount failure and a failed display manager leave different evidence. Select a stage below to connect its responsibility with the tools available at that point.

Find the handoff that failed

Firmware (BIOS/UEFI)

Before the bootloader

Possible symptom
No selected boot program starts
Evidence to inspect
Firmware diagnostics, POST codes and boot-device settings
What you can change
Boot order, device configuration and trust policy
Recovery direction
Check the selected device and platform diagnostics first. Firmware recovery procedures depend on the manufacturer.
Timing considerations
Hardware initialization and configured checks dominate; there is no universal duration.
The last successful handoff narrows the investigation. Symptoms are clues, not a diagnosis; timing depends on the system and the endpoint being measured.

Boot Optimization

Measure the system before changing it. These commands inspect a systemd-managed boot:

bash
systemd-analyze time
systemd-analyze blame
systemd-analyze critical-chain
systemd-analyze plot > boot.svg

time summarizes available phase timestamps. blame sorts observed unit activation durations, but a long duration can include waiting. critical-chain shows a time-critical ordering chain with limitations around activation, devices and parallel work. The plot helps connect those observations. None of these alone proves that the largest listed service is delaying your login by its entire reported duration. systemd-analyze.

Typical investigations include a deliberately long boot-menu timeout, slow device discovery, unnecessary startup services and storage I/O. Shortening a GRUB timeout can remove an intentional wait, while disabling a service only helps if its work or dependencies matter for the chosen endpoint. Check what the service provides before changing it, and compare the same endpoint across runs.

systemd-boot is an alternative UEFI boot manager with its own menu and configuration model. Choosing it does not guarantee a fixed time saving. Likewise, an initramfs compression change trades archive size, I/O and decompression work; its effect should be measured on the target machine. systemd-boot.

Troubleshooting Boot Failures

Recovery Approaches

First locate the failure. Firmware diagnostics or a serial console may be needed before a loader starts. Loader repair may require recovery media; a kernel regression may be investigated by selecting a previously working kernel. Once user-space logging exists, inspect the failing unit and its dependencies.

Boot parameters are interpreted by different components, so match an option to the system that understands it:

  • single or 1: compatibility aliases for rescue mode on systemd systems, not a promise of an unrestricted root shell.
  • rd.break: a debugging breakpoint supported by dracut-based initramfs environments; other implementations have their own options. dracut command-line reference.
  • init=/bin/bash: requests an alternative init program where the boot setup honors it. It does not perform normal service initialization.
  • systemd.unit=emergency.target: selects a minimal host-system recovery target. A systemd-based initramfs has separate rd.systemd.unit= handling.
  • nomodeset: disables kernel mode setting for diagnosis; it does not mean every graphics driver is absent.

Consult the relevant systemd command-line options and kernel parameter reference. Recovery authentication and available tools depend on the installation.

Common Problems

Unable to mount the root filesystem: check that the requested root device exists and that the necessary storage and filesystem support is available. Encrypted or logical volumes can add early-user-space requirements. A delay can help with late device discovery, but it cannot supply a missing driver or correct a wrong UUID. Kernel init troubleshooting.

Black screen after GRUB: the display alone does not identify the failing stage. A text console or serial log can help distinguish a kernel failure from a graphics, display-manager or session problem. Use nomodeset as a diagnostic where applicable, then investigate the relevant log.

Service timeout: inspect the unit, the job it is waiting for and the boot journal. On a systemd host, systemctl --failed and journalctl -b are useful starting points. Rescue mode may make diagnosis possible; disabling a unit without understanding its dependencies can hide the symptom or remove a required service.

Secure Boot

UEFI Secure Boot checks executable images against an authorization policy, including trusted and revoked signatures or hashes. The enrolled databases are platform configuration; they are not universally a fixed set of Microsoft keys. If a boot image is rejected, firmware may try another configured boot option. UEFI image authorization.

A common Linux path uses a firmware-trusted shim, which validates a distribution bootloader; that loader validates the kernel according to its policy. Ubuntu documents this chain and the role of Machine Owner Keys for locally signed components. It also distinguishes the signed kernel from a separately loaded initrd that is not automatically authenticated by the same signature. Module-signing requirements are enforced later by the kernel and distribution configuration. Ubuntu Secure Boot documentation.

Secure Boot therefore answers which images may execute. It does not by itself prove that every configuration file, root-filesystem byte or runtime process is trustworthy. Trace the authenticated artifacts as carefully as the control handoffs.

If you found this explanation helpful, consider sharing it with others.

Mastodon