[Tutorial] Convert to systemd-boot

Hi, I’ve been an Endeavouros user for a couple of years and I think it’s the best distro I’ve found so far; thank you and congratulations for your work.
I would like to know why “Your kernels must be kept inside your efi partition” when you use “systemd-boot”.
I have done two installations inside Virtualbox, the first with the EndeavourOs Cassini installer and the second with the Archlinux installer “archinstall”, both choosing Btrfs, encryption and systemd-boot.
In the first one, the kernel appears, as discussed in this post, in the efi partition and is loaded before putting the encryption key.
However, in the second one, the one for Archlinux, using the “archinstall” script, choosing also btrfs, encryption and systemd-boot, a total encryption of the system is performed, and the kernel is no longer in the efi partition and it is necessary to enter the key before to be able to decrypt the boot partition.
Another difference I appreciate is that Endeavoros uses “dracut” while Archlinux uses mkinitcpio.
I would like to know why in Archlinux it is possible to place the kernel in the Btrfs partition.

Endeavouros
#################### inxi -Fxxc0z ########################

System:
Kernel: 6.2.7-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.1 Desktop: GNOME v: 43.3
tk: GTK v: 3.24.37 wm: gnome-shell dm: GDM Distro: EndeavourOS base: Arch Linux
Machine:
Type: Virtualbox System: innotek GmbH product: VirtualBox v: 1.2 serial:
Chassis: Oracle Corporation type: 1 serial:
Mobo: Oracle model: VirtualBox v: 1.2 serial: UEFI: innotek GmbH
v: VirtualBox date: 12/01/2006
Battery:
ID-1: BAT0 charge: 36.0 Wh (72.0%) condition: 50.0/50.0 Wh (100.0%) volts: 10.0 min: 10.0
model: innotek 1 serial: N/A status: discharging
CPU:
Info: dual core model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx bits: 64 type: MCP
arch: Zen/Zen+ note: check rev: 1 cache: L1: 192 KiB L2: 1024 KiB L3: 4 MiB
Speed (MHz): avg: 2096 min/max: N/A cores: 1: 2096 2: 2096 bogomips: 8387
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3
Graphics:
Device-1: VMware SVGA II Adapter driver: vmwgfx v: 2.20.0.0 ports: active: Virtual-1
empty: Virtual-2, Virtual-3, Virtual-4, Virtual-5, Virtual-6, Virtual-7, Virtual-8
bus-ID: 00:02.0 chip-ID: 15ad:0405
Display: wayland server: X.Org v: 22.1.8 with: Xwayland v: 22.1.8 compositor: gnome-shell
driver: gpu: vmwgfx display-ID: :0 screens: 1
Screen-1: 0 s-res: 1918x921 s-dpi: 96
Monitor-1: Virtual-1 mapped: XWAYLAND0 res: 1912x921 size: N/A
API: OpenGL v: 4.5 Mesa 22.3.6 renderer: llvmpipe (LLVM 15.0.7 256 bits) direct-render: Yes
Audio:
Device-1: Intel 82801AA AC97 Audio vendor: Dell driver: snd_intel8x0 v: kernel bus-ID: 00:05.0
chip-ID: 8086:2415
Sound API: ALSA v: k6.2.7-arch1-1 running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.67 running: yes
Network:
Device-1: Intel 82540EM Gigabit Ethernet driver: e1000 v: kernel port: c1a0 bus-ID: 00:03.0
chip-ID: 8086:100e
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac:
Device-2: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: piix4_smbus v: N/A
port: N/A bus-ID: 00:07.0 chip-ID: 8086:7113
Drives:
Local Storage: total: 16 GiB used: 4.37 GiB (27.3%)
ID-1: /dev/sda vendor: VirtualBox model: VBOX HARDDISK size: 16 GiB speed: 3.0 Gb/s
serial:
Partition:
ID-1: / size: 15.01 GiB used: 4.29 GiB (28.6%) fs: btrfs dev: /dev/dm-0
mapped: luks-ca55fd4a-799f-4c30-b9d7-e6b4caf064e5
ID-2: /home size: 15.01 GiB used: 4.29 GiB (28.6%) fs: btrfs dev: /dev/dm-0
mapped: luks-ca55fd4a-799f-4c30-b9d7-e6b4caf064e5
ID-3: /var/log size: 15.01 GiB used: 4.29 GiB (28.6%) fs: btrfs dev: /dev/dm-0
mapped: luks-ca55fd4a-799f-4c30-b9d7-e6b4caf064e5
Swap:
ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) priority: -2 file: /swap/swapfile
Sensors:
Src: lm-sensors+/sys Message: No sensor data found using /sys/class/hwmon or lm-sensors.
Info:
Processes: 188 Uptime: 2m Memory: 3.81 GiB used: 1.18 GiB (31.0%) Init: systemd v: 253
default: graphical Compilers: gcc: 12.2.1 Packages: pm: pacman pkgs: 846
Client: Unknown Client: systemd inxi: 3.3.25

Archlinux
[santi@archlinux ~]$ inxi -Fxxc0z
System:
Kernel: 6.2.7-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
Desktop: GNOME v: 43.3 tk: GTK v: 3.24.37 wm: gnome-shell dm: GDM
Distro: Arch Linux
Machine:
Type: Virtualbox System: innotek GmbH product: VirtualBox v: 1.2
serial: Chassis: Oracle Corporation type: 1
serial:
Mobo: Oracle model: VirtualBox v: 1.2 serial:
UEFI: innotek GmbH v: VirtualBox date: 12/01/2006
Battery:
ID-1: BAT0 charge: 36.5 Wh (73.0%) condition: 50.0/50.0 Wh (100.0%)
volts: 10.0 min: 10.0 model: innotek 1 serial: N/A status: discharging
CPU:
Info: dual core model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
bits: 64 type: MCP arch: Zen/Zen+ note: check rev: 1 cache: L1: 192 KiB
L2: 1024 KiB L3: 4 MiB
Speed (MHz): avg: 2096 min/max: N/A cores: 1: 2096 2: 2096 bogomips: 8387
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3
Graphics:
Device-1: VMware SVGA II Adapter driver: vmwgfx v: 2.20.0.0 ports:
active: Virtual-1 empty: Virtual-2, Virtual-3, Virtual-4, Virtual-5,
Virtual-6, Virtual-7, Virtual-8 bus-ID: 00:02.0 chip-ID: 15ad:0405
Display: wayland server: X.org v: 1.21.1.7 with: Xwayland v: 22.1.8
compositor: gnome-shell driver: gpu: vmwgfx display-ID: 0
note: no compositor data
Monitor-1: Virtual-1 size-res: N/A
API: EGL/GBM Message: No known Wayland EGL/GBM data sources.
Audio:
Device-1: Intel 82801AA AC97 Audio vendor: Dell driver: snd_intel8x0
v: kernel bus-ID: 00:05.0 chip-ID: 8086:2415
Sound API: ALSA v: k6.2.7-arch1-1 running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.67 running: yes
Network:
Device-1: Intel 82540EM Gigabit Ethernet driver: e1000 v: kernel port: c1a0
bus-ID: 00:03.0 chip-ID: 8086:100e
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac:
Device-2: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge
driver: piix4_smbus v: N/A port: N/A bus-ID: 00:07.0 chip-ID: 8086:7113
Drives:
Local Storage: total: 16 GiB used: 5.29 GiB (33.0%)
ID-1: /dev/sda vendor: VirtualBox model: VBOX HARDDISK size: 16 GiB
speed: 3.0 Gb/s serial:
Partition:
ID-1: / size: 15.48 GiB used: 5.22 GiB (33.7%) fs: btrfs dev: /dev/dm-0
mapped: luksdev
ID-2: /boot size: 510 MiB used: 64.3 MiB (12.6%) fs: vfat dev: /dev/sda1
ID-3: /home size: 15.48 GiB used: 5.22 GiB (33.7%) fs: btrfs
dev: /dev/dm-0 mapped: luksdev
ID-4: /var/log size: 15.48 GiB used: 5.22 GiB (33.7%) fs: btrfs
dev: /dev/dm-0 mapped: luksdev
Swap:
ID-1: swap-1 type: zram size: 1.91 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
Src: lm-sensors+/sys Message: No sensor data found using /sys/class/hwmon
or lm-sensors.
Info:
Processes: 181 Uptime: 2m Memory: 3.81 GiB used: 1.22 GiB (32.0%)
Init: systemd v: 253 default: graphical Compilers: gcc: 12.2.1 Packages:
pm: pacman pkgs: 733 Shell: Bash v: 5.1.16 running-in: kgx inxi: 3.3.25

Thanks in advance.

As far as I know, archinstall mounts the ESP at /boot and the kernel and initrams are stored in the ESP at /boot.

Can I see the output of findmnt --real from your Arch install?

[santi@archlinux ~]$ findmnt --real
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/luksdev[/@] btrfs rw,relatime,space
├─/run/user/1000/doc portal fuse.po rw,nosuid,nodev,r
├─/boot /dev/sda1 vfat rw,relatime,fmask
├─/.snapshots /dev/mapper/luksdev[/@.snapshots] btrfs rw,relatime,space
├─/home /dev/mapper/luksdev[/@home] btrfs rw,relatime,space
├─/var/cache/pacman/pkg
│ /dev/mapper/luksdev[/@pkg] btrfs rw,relatime,space
└─/var/log /dev/mapper/luksdev[/@log] btrfs rw,relatime,space

Yes, the kernels and initrams are being stored in the ESP there, not in btrfs.

And the ESP is in the efi vfat partition?

I understood now, /boot is in the vfat partition and inside is ESP and initramfs

1 Like

ESP is EFI System Partition. It is the EFI partition.

Thanks for your help and congratulations for all Endeavouros team, always works like a charm for me in my computers and and i always found the help i needed

2 Likes

Just a comment to say thanks for the guide :slight_smile:

I’ve installed EndeavourOS around October/November last year, and between this guide and the one for Dracut it was super easy to switch to the new choices done by the maintainers of the distro.
So far it has been an amazing experience!

1 Like

I’d like to apologize if reviving this topic from “5 months ago” will break any of this forum’s rules.

I’ve distro-hopped but always find my old self back in the Purple now this time with Cassini Nova. I had been an ArchBang fan up until yesterday - always with grub - and often getting rubbed out by grub over the years. My Linux knowledge is bits and pieces - never enough time for a cool Linux life.

So this tutorial I did read through and felt I understood the steps but … attempting it admittedly, with a solid ArchBang system running well and to my liking, the 2nd step stopped me instantly:

Next, we can cleanup /boot to prepare for the changes

sudo rm -r /boot/efi … right there. I believe I got “resource busy” . Yep, I was not in Endeavour but in ArchBang, and yep, I should know what I did wrong and why but nope, I don’t, and it’s probably something so obvious that even a bits & pieces old newbie should’ve realized … but I don’t.

I of course, did the first step, blowing grub away, which felt enjoyable, and of course, I couldn’t reboot. So with my trusty EOS Cassini USB stick, I’m back with you guys again.

Wasn’t I supposed to be within a WM/DE (I’m always in i3 with some xfce mixed in sometimes) and well past a successful grub boot? Nothing was wrong at all with grub nor with efibootmgr (dual boot on an iMac). I had no problems whatsoever. Just wanted to see if the tutorial would work. Nothing lost with my data, all backed up previously.

So can anyone clue me in on what marbles I’m missing?

Thank you - sorry for typing so much …

Can you share the output of findmnt --real

1 Like

Unfortunately, pretty far from my machine for at least 12 hours. Will definitely do, but it’s currently in a freshly-installed EOS Cassini with systemd-boot right now - no longer where I messed it up previously in ArchBang with a working grub. Thanks dalto for replying.

OK, well, in that case it is too late.

What do you need help with at this point?

1 Like

These first few lines in fbodymechanic’s tutorial here: Next we need to remove grub:

sudo pacman -Rc grub

Next, we can cleanup /boot to prepare for the changes

sudo rm -r /boot/efi /boot/grub /boot/initramfs* /boot/vmlinuz*


I removed grub, no problem. But then the “sudo rm -r /boot/efi” stopped me with I believe a “resource busy or not found” … or words to that effect error. So my mistake in pursuing that, in the interest of time I took my EOS stick and reinstalled Cassini. But why the “resource busy” error? Wasn’t the tutorial going to continue after removing grub?

My mistake in NOT pursuing that I mean. I hadn’t much time left in the early am so I foolishly reinstalled the whole unbootable mess as a newly installed EOS with systemd-boot and stopped there … for now.

Nobody can truly answer that since you have reinstalled but my best guess is that you had a terminal or file manager open looking at one of those directories. Perhaps you wanted to see what was in it before you deleted them?

OMgosh, yes I DID have Thunar open - hours earlier - wasn’t really using it at that moment - and I probably had it pointing to my home directory. But wow, alright thank you.

Just so I’m clear, it would’ve been a lot smarter to have nothing running in any workstation except me in my terminal before I attempted the tutorial. Ok, thank you. Time to close this I think! Thanks!

when I run
sudo rm -r /boot/efi /boot/grub /boot/initramfs* /boot/vmlinuz*
I got
rm: cannot remove '/boot/efi': Device or resource busy

I just have firefox and konsole opening, what should I do?

System: Intel 11gen + 3080Ti, latest EndeavourOS, more info: http://ix.io/4zTi

I run

sudo mkdir /efi
efidevice=$(findmnt /boot/efi -no SOURCE) # save the efi partition location
sudo umount /boot/efi
sudo mount ${efidevice} /efi

first then remove it now it works :slight_smile: :slight_smile:

2 Likes

Hi, I just finish converting and it works well :slight_smile:

One thing I am curious is that this is what it is like in side /efi/loader/entries

-> bsh > ls /efi/loader/entries
2564d956daa649c6bfd89178923d12f1-6.1.37-1-lts.conf           2564d956daa649c6bfd89178923d12f1-6.4.1-arch2-1.conf
2564d956daa649c6bfd89178923d12f1-6.1.37-1-lts-fallback.conf  2564d956daa649c6bfd89178923d12f1-6.4.1-arch2-1-fallback.conf

I am just wondering what those 2564d956daa649c6bfd89178923d12f1 are because from the EndeavourOS wiki I saw if I want to make mainline kernel default I can add default .....-*-arch?-?.conf to /efi/loader/loader.conf, but would the sequence before change after I update/installed kernels? In Arch wiki it use arch.conf, can those entries’ name be changed?