Skip to content

Recover systemd-boot

Sometimes when updating your system (in my case using yay), when you go to reboot your boot manager you will only have the option Reboot into firmware interface.

The issue can be anything really, but usually it happens when installing a package, and when an update comes around, something breaks.

This guide was written with EndeavourOS in mind.

Resources

How-to

  1. Boot into the live environment; I used EndeavourOS.
  2. Change to root. sudo su
  3. List the system partitions. lsblk -f. You should see something like this. The relevant section is nvme0n1, more specifically nvme0n1p1 and nvme0n1p2. We need to mount both of these.
    [root@EndeavourOS liveuser]# lsblk -f
    NAME        FSTYPE   FSVER            LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
    loop0       squashfs 4.0                                                                     0   100% /run/archiso/airootfs
    sda
    ├─sda1      exfat    1.0              Ventoy      4E21-0000
    │ └─ventoy  iso9660  Joliet Extension EOS_202406  2024-06-25-11-30-26-00                     0   100% /run/archiso/bootmnt
    └─sda2      vfat     FAT16            VTOYEFI     223C-F3F8
    nvme0n1
    ├─nvme0n1p1 vfat     FAT32                        5E74-E696
    ├─nvme0n1p2 ext4     1.0              endeavouros 1a236633-49a9-4fa6-918a-8129dd30617a   33.5G    79% /run/media/liveuser/endeavouros
    └─nvme0n1p3 swap     1                swap        3556ab04-2191-4da9-b168-3df725fdaaab
    
  4. Mount the root partition. mount /dev/nvme0n1p2 /mnt
  5. Mount the efi partition. mount /dev/nvme0n1p1 /mnt/efi
  6. arch-chroot into the mounted system. arch-chroot /mnt
  7. Optional step. I need to uninstall the package which broke my system which in this case is zfs-utils. pacman -Rns zfs-utils. This removes the package as well as the dependencies.
  8. Now the actual fix. Reinstalling the kernel. Run reinstall-kernels The ouput should show no errors and look something like this:
    [root@EndeavourOS /]# reinstall-kernels
    Installing kernel 6.10.8-arch1-1
    dracut[I]: Executing: /usr/bin/dracut --no-hostonly --force /efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd-fallback 6.10.8-arch1-1
    dracut[I]: *** Including module: systemd ***
    dracut[I]: *** Including module: systemd-ask-password ***
    dracut[I]: *** Including module: systemd-initrd ***
    dracut[I]: *** Including module: systemd-journald ***
    dracut[I]: *** Including module: systemd-modules-load ***
    dracut[I]: *** Including module: systemd-pcrphase ***
    dracut[I]: *** Including module: systemd-sysctl ***
    dracut[I]: *** Including module: systemd-sysusers ***
    dracut[I]: *** Including module: systemd-tmpfiles ***
    dracut[I]: *** Including module: systemd-udevd ***
    dracut[I]: *** Including module: modsign ***
    dracut[I]: *** Including module: i18n ***
    dracut[I]: *** Including module: btrfs ***
    dracut[I]: *** Including module: crypt ***
    dracut[I]: *** Including module: dm ***
    dracut[I]: *** Including module: kernel-modules ***
    dracut[I]: *** Including module: kernel-modules-extra ***
    dracut[I]: *** Including module: lvm ***
    dracut[I]: *** Including module: mdraid ***
    dracut[I]: *** Including module: nvdimm ***
    dracut[I]: *** Including module: pcmcia ***
    dracut[I]: *** Including module: qemu ***
    dracut[I]: *** Including module: qemu-net ***
    dracut[I]: *** Including module: systemd-cryptsetup ***
    dracut[I]: *** Including module: fido2 ***
    dracut[I]: *** Including module: pkcs11 ***
    dracut[I]: *** Including module: hwdb ***
    dracut[I]: *** Including module: lunmask ***
    dracut[I]: *** Including module: resume ***
    dracut[I]: *** Including module: rootfs-block ***
    dracut[I]: *** Including module: terminfo ***
    dracut[I]: *** Including module: udev-rules ***
    dracut[I]: *** Including module: virtiofs ***
    dracut[I]: *** Including module: dracut-systemd ***
    dracut[I]: *** Including module: usrmount ***
    dracut[I]: *** Including module: base ***
    dracut[I]: *** Including module: fs-lib ***
    dracut[I]: *** Including module: shutdown ***
    dracut[I]: *** Including modules done ***
    dracut[I]: *** Installing kernel module dependencies ***
    dracut[I]: *** Installing kernel module dependencies done ***
    dracut[I]: *** Resolving executable dependencies ***
    dracut[I]: *** Resolving executable dependencies done ***
    dracut[I]: *** Hardlinking files ***
    dracut[I]: *** Hardlinking files done ***
    dracut[I]: *** Generating early-microcode cpio image ***
    dracut[I]: *** Constructing GenuineIntel.bin ***
    dracut[I]: *** Store current command line parameters ***
    dracut[I]: *** Stripping files ***
    dracut[I]: *** Stripping files done ***
    dracut[I]: *** Creating image file '/efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd-fallback' ***
    dracut[I]: *** Creating initramfs image file '/efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd-fallback' done ***
    dracut[I]: Executing: /usr/bin/dracut --hostonly --no-hostonly-cmdline -f /efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd 6.10.8-arch1-1
    dracut[I]: *** Including module: systemd ***
    dracut[I]: *** Including module: systemd-ask-password ***
    dracut[I]: *** Including module: systemd-initrd ***
    dracut[I]: *** Including module: systemd-journald ***
    dracut[I]: *** Including module: systemd-modules-load ***
    dracut[I]: *** Including module: systemd-sysctl ***
    dracut[I]: *** Including module: systemd-sysusers ***
    dracut[I]: *** Including module: systemd-tmpfiles ***
    dracut[I]: *** Including module: systemd-udevd ***
    dracut[I]: *** Including module: i18n ***
    dracut[I]: *** Including module: kernel-modules ***
    dracut[I]: *** Including module: kernel-modules-extra ***
    dracut[I]: *** Including module: pcmcia ***
    dracut[I]: *** Including module: hwdb ***
    dracut[I]: *** Including module: resume ***
    dracut[I]: *** Including module: rootfs-block ***
    dracut[I]: *** Including module: terminfo ***
    dracut[I]: *** Including module: udev-rules ***
    dracut[I]: *** Including module: dracut-systemd ***
    dracut[I]: *** Including module: usrmount ***
    dracut[I]: *** Including module: base ***
    dracut[I]: *** Including module: fs-lib ***
    dracut[I]: *** Including module: shutdown ***
    dracut[I]: *** Including modules done ***
    dracut[I]: *** Installing kernel module dependencies ***
    dracut[I]: *** Installing kernel module dependencies done ***
    dracut[I]: *** Resolving executable dependencies ***
    dracut[I]: *** Resolving executable dependencies done ***
    dracut[I]: *** Hardlinking files ***
    dracut[I]: *** Hardlinking files done ***
    dracut[I]: *** Generating early-microcode cpio image ***
    dracut[I]: *** Constructing GenuineIntel.bin ***
    dracut[I]: *** Store current command line parameters ***
    dracut[I]: *** Stripping files ***
    dracut[I]: *** Stripping files done ***
    dracut[I]: *** Creating image file '/efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd' ***
    dracut[I]: *** Creating initramfs image file '/efi/343bef0b023b4aae84fd922fc9b99d13/6.10.8-arch1-1/initrd' done ***
    [root@EndeavourOS /]#
    

Reboot and you should see your regular boot manager options.