The systemd-boot utility functions as a UEFI boot manager for modern Linux systems. It displays a text menu for selecting boot entries and supports direct kernel command line editing.
Installation Prerequisites
Verify UEFI mode before installing systemd-boot. Run the following command:
$ ls /sys/firmware/efi/efivars
The directory exists when the system boots in UEFI mode. Legacy BIOS systems cannot use systemd-boot.
CONFIG_EFI_STUB enabled for direct EFI execution.
Installing systemd-boot
Install systemd-boot to the EFI System Partition:
# bootctl install
This command copies the boot manager files to the ESP. The UEFI firmware creates an entry named “Linux Boot Manager” in the boot order.
The installation places files at different locations based on architecture:
| Architecture | File Location |
|---|---|
| x86-64 | esp/EFI/systemd/systemd-bootx64.efi |
| x86-64 Fallback | esp/EFI/BOOT/BOOTX64.EFI |
| IA32 | esp/EFI/systemd/systemd-bootia32.efi |
XBOOTLDR Partition Setup
Create an extended boot partition to separate kernels from the ESP. This helps when dual-booting with Windows on small ESP partitions.
Set the partition type GUID to bc13c2ff-59e6-4262-a352-b275fd6f7172. Use ea00 for gdisk or xbootldr for fdisk.
/efi and XBOOTLDR at /boot during installation.
The XBOOTLDR partition stores kernels and initramfs images. The ESP holds only the boot manager and configuration files.
Configuration Files
Configure the boot manager through files on the ESP. The main configuration resides in /loader/loader.conf.
Basic Configuration
Edit /loader/loader.conf to set boot behavior:
default arch.conf
timeout 3
console-mode auto
editor no
The default parameter specifies the boot entry filename without extension. Set timeout to the menu display duration in seconds.
| Parameter | Purpose |
|---|---|
default |
Entry to boot automatically |
timeout |
Menu display seconds |
console-mode |
Screen resolution setting |
editor |
Enable kernel line editing |
Creating Boot Entries
Place boot entry files in /loader/entries/ with the .conf extension. Each file defines one boot option.
Create an entry file:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=partition-uuid rw
Replace partition-uuid with the actual partition UUID. Get the UUID with:
$ blkid -s PARTUUID -o value /dev/sdXN
Keyboard Controls
Navigate the boot menu using these keys:
| Key | Action |
|---|---|
| Up/Down | Select entry |
| Enter | Boot selected entry |
| d | Set as default |
| e | Edit kernel parameters |
| + | Increase timeout |
| – | Decrease timeout |
Press Space during boot to show the menu when timeout equals zero.
Updating systemd-boot
Update the boot manager after systemd package upgrades. Run the update command:
# bootctl update
The boot manager functions independently from the installed systemd version. Updates add new features and fix bugs.
Automatic Updates
Enable automatic updates through a systemd path unit. The system updates the boot manager when package files change.
Most distributions provide automatic update mechanisms. Check distribution documentation for specific procedures.
Boot Counting and Fallback
The boot manager tracks boot attempts automatically. Entries with counters in their filenames participate in this system.
Counter format uses two numbers separated by hyphens. The first shows remaining attempts. The second counts completed tries.
Failed entries move to the top of the menu. Working entries appear at the bottom. The default selection favors verified entries.
Working with Unified Kernel Images
Store unified kernel images in /EFI/Linux/ on the ESP. The boot manager detects these files automatically without manual entry creation.
Unified images combine kernel, initramfs, and command line into one EFI executable. This simplifies boot configuration and improves security.
EFI Variables
The boot manager communicates with the operating system through EFI variables. These variables store boot state and configuration.
| Variable | Purpose |
|---|---|
LoaderEntryDefault |
Persistent default entry |
LoaderEntryOneShot |
Next boot entry only |
LoaderConfigTimeout |
Menu display duration |
Use bootctl commands to modify these variables. The set-default command changes the default entry. The set-oneshot command sets a single-use override.
FAQs
systemd-boot requires UEFI firmware. Legacy BIOS systems cannot use this boot manager. The kernel needs EFI stub support enabled.
Press and hold the Space key during system initialization. This brings up the hidden menu before automatic boot occurs.
Configuration files reside on the EFI System Partition. The main config is /loader/loader.conf. Boot entries live in /loader/entries/.
Yes, systemd-boot detects Windows Boot Manager automatically. It appears as a menu option without manual configuration. Windows entries auto-populate in the boot list.
Run bootctl update as root after systemd package updates. This copies new boot manager files to the ESP. Enable automatic updates through systemd units.