[Tutorial] Convert to systemd-boot

Yes. Your efi partition is full.

If you only have one kernel, you can do this step first which will free up some space.

sudo rm -r /efi/efi /efi/grub /efi/initramfs* /efi/vmlinuz*
sudo mv /efi/*ucode.img /boot/.

I should probably move that step in the tutorial actually.

1 Like

And then run the script againā€¦gotcha!

1 Like
EndeavourOSāžœ  /  į…  sudo rm -r /efi/efi /efi/grub /efi/initramfs* /efi/vmlinuz*
zsh: no matches found: /efi/initramfs*

After running the script I get the same error as beforeā€¦ no space left on device.

What does ls -l /efi show?

EndeavourOSāžœ  /  į…  ls -l /efi
drwxr-xr-x - root 22 dec 22:33 ļ„• a463d5e357b443a18f592fa89825f7ee
drwxr-xr-x - root 22 dec 22:30 ļ„• EFI
drwxr-xr-x - root 22 dec 22:30 ļ„• loader

Try installing this file which should make the initrd smaller:

1 Like
dracut: *** Creating image file '/efi/a463d5e357b443a18f592fa89825f7ee/6.1.1-arch1-1/initrd-fallback' ***
dracut: *** Creating initramfs image file '/efi/a463d5e357b443a18f592fa89825f7ee/6.1.1-arch1-1/initrd-fallback' done ***

That did the trick!

1 Like

One more question. Everything went okay after rebooting but I can see there is hardly any space left on /efi

/dev/nvme0n1p1  300M  271M   29M  91% /efi

meaning I either have to resize the partition or stick to only one kernel? How much space will be freed if I run say lz4 or whatever it is that compresses the most?

I donā€™t think you will get a massive saving by switching compression methods but you could try and see. Of course, the more intense the compression, the longer your bootup time will be.

I would probably just resize the efi partition if that is doable on your machine.

Probably the best solution but resizing partitions got me burnt in the past. Ah well living on the edge I guess. Thanks again for your advice.

1 Like

Gparted has never failed me before. May I ask what happened?

If you do it in live mode with gparted, itā€™s pretty safe. I have done this many times in the last few years and nothing has ever gone wrong.

2 Likes

After converting to systemd-boot, in the case of multiboot, in addition to Windows, other installed ones (e.g. Linux distributions) also appear automatically after system boot, or do they have to be configured manually?

According to Arch Wiki, systemd-boot will automatically detect Windows Boot Manager (located in \EFI\Microsoft\Boot\bootmgfw.efi). No OS Prober is needed (like in Grub).

For more details, refer to this:

https://wiki.archlinux.org/title/Dual_boot_with_Windows#UEFI_systems

To quote the Arch Wiki:

systemd-boot will automatically check at boot time for Windows Boot Manager at the location /EFI/Microsoft/Boot/Bootmgfw.efi, UEFI shell /shellx64.efi and EFI Default Loader /EFI/BOOT/bootx64.efi, as well as specially prepared kernel files found in /EFI/Linux/. When detected, corresponding entries with titles auto-windows, auto-efi-shell and auto-efi-default, respectively, will be generated. These entries do not require manual loader configuration.

Thatā€™s what the Arch Wiki says. However, Iā€™m not sure if you need to copy the Bootmgfw.efi from your windows partition into your EFI partition for it to work. Other more experienced users might be able to answer this.

@anon50380917 I agree. GParted has never failed me before. It is simple and intuitive to use.

1 Like

Hard to say but something got corrupted after resizing cause the system would not boot anymore. Anyway I did fire up a live usb and everything went smoothly nowā€¦ :partying_face:

First time I am considering systemd-boot over grub2.

As I understand it, the bootloader and kernels have to fit inside the ESP which in my case will be /efi,

The kernels I plan to use are zen, lts and the normal linux one and I guess there needs to be space for their fallbacks.

What size should the partition be?

I saw 500MB is minimum and noticed some using 538MB, I donā€™t want to use dual-boot or a MS Windows boot at this stage.

Awesome tutorial btw, @dalto :rocket:

I have two kernels installed (linux and linux-lts)

$ du -sh /boot
215M	/boot

That should give you a rough idea of how much space you need.

Here are a few things that I observed. If you use dracut, the size of the initrd files are typically as follows:

  1. normal hostonly initrd ~16 to 20MB
  2. fallback initrd ~75 to 85MB

If you want a better estimate, you could also run dracut from the terminal first to generate all the images for each kernel and then take note of their sizes.

Awesome, I got

228M /efi

5,5M /boot

Thanks for the help

So you already made the switch? :rofl: :rofl: