Configuring systemd-boot for Linux: Faster, Sleeker, and Much ‘Cleaner’ Than GRUB2

Linux tutorial - IT technology blog
Linux tutorial - IT technology blog

Upgrade to systemd-boot in Just 5 Minutes

If you are using modern Linux distributions like Arch Linux, Fedora, or Debian on UEFI and find GRUB2 too bloated, systemd-boot is the perfect alternative. Instead of struggling with dozens of complex syntaxes, you only need to work with a few plain text files that are extremely easy to understand. In fact, systemd-boot can help your machine shave 2-3 seconds off the boot screen wait time compared to GRUB.

1. Prerequisites

Your machine must be running in UEFI mode. Open the terminal and check with the command:

ls /sys/firmware/efi

If you see a list of files, you’re ready. Otherwise, if you get a “No such file or directory” error, your machine is using old BIOS (Legacy), and systemd-boot will not work there.

2. Installing the Bootloader

Ensure your EFI partition is mounted (usually at /boot or /efi). Just run a single command:

bootctl install

This command will automatically copy the necessary executables to the EFI partition and set up the standard directory structure for you.

3. Configuring the Loader

Open the file /boot/loader/loader.conf and paste this simple content:

default  arch.conf
timeout  3
console-mode max

4. Creating a Boot Entry for the Operating System

Create a new file /boot/loader/entries/arch.conf with the following content:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
options root=UUID=550e8400-e29b-41d4-a716-446655440000 rw

Tip: To get the correct UUID of your hard drive, use the blkid command. Just save and restart your computer; you will see the difference immediately.

Why I ‘Broke Up’ With GRUB2

GRUB2 is like a heavy-duty truck: it can carry everything from ancient BIOS to the latest UEFI, supporting LVM, RAID, or LUKS. But that versatility comes at a price: extreme complexity. Every time you update the kernel, you have to run grub-mkconfig and hope that the long grub.cfg file doesn’t encounter any strange errors.

Systemd-boot takes a different path: Absolute Minimalism. It is simply a navigation menu for UEFI. Each kernel or operating system is managed by an individual .conf file. If one file is corrupted, it doesn’t crash your entire boot menu the way GRUB often does.

I once wasted an entire afternoon as a sysadmin just debugging a kernel panic error. It turned out that after changing kernel parameters in GRUB, I forgot to run the config update command. As a result, the machine still tried to boot with the old configuration. With systemd-boot, that never happens: edit the text file, save, done. No intermediate commands required.

Detailed Configuration to Master Your System

To manage systemd-boot effectively, you only need to understand two parts: the general configuration and the individual boot entries.

General Configuration File (loader.conf)

Located at /boot/loader/loader.conf, this file controls how the menu is displayed:

  • default: The name of the entry file (without the .conf extension) that will run automatically.
  • timeout: The number of seconds to wait. Set to 0 if you want to boot directly, only showing the menu when holding the Space key.
  • editor: Allows editing kernel parameters at boot time. It should be set to no for enhanced security.

Entry Configuration (entries/*.conf)

Important note: systemd-boot can only read files located within the EFI partition. Therefore, the kernel file (vmlinuz) and initramfs must reside in this partition.

title   Linux LTS (Fallback)
linux   /vmlinuz-linux-lts
initrd  /initramfs-linux-lts.img
options root=PARTUUID=yyyy-yyyy rw quiet

If you use an Intel or AMD CPU, don’t forget to load the microcode to patch hardware security vulnerabilities like Spectre or Meltdown right from startup:

initrd  /intel-ucode.img
initrd  /initramfs-linux.img

Note: The microcode must always come before the main initramfs file.

Automation: Letting the Computer Work for You

Many people avoid systemd-boot because they have to manually copy the kernel to the EFI partition. Don’t worry, we have tools to handle this.

On Arch Linux, you can use pacman hooks or configure mkinitcpio to automatically push the kernel to the right location after each update. The cleanest way is to mount the EFI partition directly to the /boot directory. This way, any kernel updates from the package manager will automatically be exactly where systemd-boot needs to find them.

Practical Experience: When Should You Switch?

Consider using systemd-boot if:

  • Speed is a priority: You want to shorten the time from pressing the power button to the login screen.
  • Pure UEFI system: You don’t care about old standards or legacy virtual machines.
  • Dual-booting with Windows: Systemd-boot is very smart; it automatically detects Windows’ bootmgfw.efi without you having to touch the configuration.

However, stay with GRUB if you like menus with flashy backgrounds, vibrant colors, or if you need to boot from complex filesystem formats like Btrfs without wanting a separate partition for the kernel.

Pro-Tips to Avoid Headaches

1. Use PARTUUID: In the configuration, root=PARTUUID=... is more stable than UUID because it precisely identifies the partition on a GPT disk, avoiding confusion when you plug in new hard drives.

2. Useful Shortcuts:

  • Press Space: Show the menu immediately.
  • Press e: Quickly edit kernel parameters for system rescue.
  • Press d: Quickly select the default operating system for the next boot.

3. Health Check: The command bootctl status will tell you everything from the running version to the entries the system is currently recognizing.

Changing your bootloader might sound risky, but with systemd-boot, everything becomes more transparent and easier to control. Try it once, and you’ll see that GRUB is truly an unnecessary mess.

Share: