Systemd-boot is an alternative Linux bootloader that is powered by the Systemd startup system. It has dozens of modern features, including faster boot, better EFI support and a lot more, making it an excellent choice for Arch Linux. Setting up Systemd-boot on Arch Linux is a tricky process, so before we begin, we highly recommend backing up your critical data.
Note: Systemd-boot only works with systems that boot using UEFI. If you do not have UEFI, stick with Grub.
Install Arch Linux
Systemd-boot is an alternative bootloader to Grub. Currently, it isn’t possible to transition an existing Arch Linux system running Grub on UEFI to the Systemd-boot system, sadly.
Instead, you must start with a fresh installation of the Arch Linux operating system, and choose Systemd-boot as your default bootloader, rather than the standard Grub.
In the past on Addictivetips, I wrote a tutorial all about how to install Arch Linux. It is a long, and detailed installation process, filled with a ton of different steps. All of these steps are critical and will help you get running with Systemd-boot. Follow the instructions to install Arch Linux on your system. Be sure to follow the GPT/EFI method that it outlines.
During the GPT/EFI installation instructions for Arch Linux, please skip over any instructions in the guide that show you how to install the Grub bootloader. It’s critical that you skip the Grub instructions, or Systemd-boot will not work.
After you’ve gone through the GPT/EFI method for installing Arch Linux, keep your system on and logged into the Arch Chroot (live disk), come back to this post and follow the instructions to learn how to set up Systemd-boot as your bootloader on Arch Linux.
Set up Systemd-boot
During the Arch Linux installation guide for EFI/GPT, three partitions were set up and formatted on /dev/sda (AKA the first hard drive connected to the system). These partitions are the following:
- Partition 1 – A Fat32 EFI partition (roughly 512 MB.)
- Partition 2 – An Ext4 Root partition (sized at whichever you choose it to be.)
- Partition 3 – A Linux-Swap partition (sized at whichever you choose it to be.)
The first thing that needs to be done in Arch Linux is to change the boot flags for the Fat32 partition. Swapping these flags is best done with the Gdisk app. To get Gdisk, use the following Pacman command in the Arch-Chroot terminal prompt.
pacman -S gdisk
With the app set up, open up your hard drive in the Gdisk application.
Running the above command will put /dev/sda in the Gdisk app. Then, you’ll see a prompt that asks you to choose between MBR, BSD, APM, and GPT. Write in GPT and press Enter.
From here, write t in the prompt to change the Fat32 partition’s flag.
After writing in the t command, write in 1 to tell the app to work with the Fat32 partition.
Write in the EFI System hex code into the Gdisk prompt.
Save the changes with the w command.
Note: ignore the warning; it will not erase anything.
After writing the changes to the disk, close Gdisk with the q command.
Now that the Fat32 EFI partition’s flags are set correctly use bootctl to install Systemd-boot to your new Arch Linux system.
bootctl --path=/boot install
Let the Bootctl command run its course. It should automatically set up default configuration files.
Next, you must find the UUID for /dev/sda2, the partition that Arch Linux is installed.
Launch the file in Nano. To find out PARTUUID information, run:
Look through the blkid command and write down the number after
PARTUUID=" on a scrap piece of paper, or save as a note on your phone, etc. The number you need to save should look something like the example below.
After getting the UUID for your Root partition, use the touch command to make a new Arch Linux menu entry.
Open up the new file in Nano.
nano -w /boot/loader/entries/arch.conf
Paste the following code into the “arch.conf” file.
Note: change PARTUUID=YOUR-PARTUUID-CODE-HERE with your code.
title Arch Linux
options root=PARTUUID=YOUR-PARTUUID-CODE-HERE rw
When done, save Nano with Ctrl + O and Exit with Ctrl + X.
With the Arch entry taken care of, it’s time to clear the Arch default “loader.conf” file and replace it with better settings.
echo ' ' > /boot/loader/loader.conf
Open the “loader.conf” file in the Nano text editor using the command below.
nano -w /boot/loader/loader.conf
Paste the following code into the Nano text editor.
Update Systemd-boot with bootctl.
Once bootctl is done updating, Systemd-boot is ready to use. From here, head back to the How to install Arch Linux guide if you have yet to choose a desktop environment for your new Arch PC. Otherwise, reboot and load up your new Systemd-powered Arch setup!