Systemd-boot does not find root Partition

Hello,

i have a fresh installation of Fedora 33.
After the installation i changed the bootloader from grub to systemd-boot.

My current partition layout is the following:

  • /boot (512 MB) EFI Boot
  • LUKS2 Encrypted LVM
    • main-root
    • main-home

The system boots normally and asked me for the LUKS2 Password.
After that it just stopped with an timeout trying to get the Root Partition.

I think i had to tell systemd-boot where the find the root partition, but i don’t know what i had to add and where i had to add it.

It is probably just incorrect parameters being passed on the kernel command line. For example, you might be missing the rd.lvm.lv=... command line parameter that is necessary for LVM or the root=... parameter might be incorrect. You will likely need to troubleshoot the issue by booting to the dracut emergency shell and checking the log messages to see what it is trying and failing to find. You should be able to get to the shell by pressing e while booting up and then adding rd.shell to the list of kernel parameters.

When using systemd-boot I like to add the line timeout 6 to /loader/loader.conf so the menu will pause for a few seconds when the system boots up.

2 Likes

I have solved it by adding the following line to the options inside the /loader/entries/entry.conf file:

cryptdevice=/dev/sda2:main root=/dev/mapper/main-root

I also watched your video on fedoramagazine on how to replace grub with systemd-boot =).

But i have another issue with that. I want to do a minimal installation with the netinstall image.
I also choose to not install a bootloader in the Partition Menu during the installation. But the installation does not succeed. It stops with an error saying it could not unpack the grub2-efi package.
Is there a solution how to exclude grub?

1 Like

I haven’t done a recent installation with netinstall. The error you describe sounds like a bug. It shouldn’t be trying to unpack grub2-efi if you chose not to install a bootloader. Unfortunately, non-grub bootloaders are not well supported in Fedora these days. You may have to install grub and then manually remove it and replace it with sd-boot afterwards. Also, I think I heard that Fedora is currently reworking some things with respect to how the bootloaders work, so it might be that things are particularly buggy right now just because of the recent changes.

Also, be sure to add your kernel parameters to /etc/kernel/cmdline if you have not already so that when new kernels are installed, the appropriate options will get copied to the corresponding /loader/entries/<machine_id>-<kernel_version>.conf file. You will need to create the file if it does not already exist. For example, mine looks like this:

[/home/gregory]$ cat /etc/kernel/cmdline 
root=zfs:pool/0 bootfs.snapshot video=DP-1:d quiet rhgb

Good luck! :slightly_smiling_face:

1 Like