You are not logged in.

#1 2024-01-25 03:27:38

nikinbaidarr
Member
Registered: 2021-05-06
Posts: 92

[SOLVED] boots to emergency mode after upgrade

I use systemd-boot to boot into my system.

$bootctl list
type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux (arch.conf) (default) (selected)
           id: arch.conf
       source: /efi//loader/entries/arch.conf
        linux: /efi//EFI/arch/vmlinuz-linux
       initrd: /efi//EFI/arch/initramfs-linux.img
      options: root=UUID=ee8fa627-41d1-4cc8-80a8-8dd3110891b2   rw quiet loglevel=3>

         type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux (arch-fallback.conf)
           id: arch-fallback.conf
       source: /efi//loader/entries/arch-fallback.conf
        linux: /efi//EFI/arch/vmlinuz-linux
       initrd: /efi//EFI/arch/initramfs-linux-fallback.img
      options: root=UUID=ee8fa627-41d1-4cc8-80a8-8dd3110891b2   rw quiet loglevel=3>

As you can see the path to kernel is /efi/EFI/arch/** (although bootctl list says /efi//EFI/arch).  What's with the extra '/'?

This is what I have in /efi/loader/entries/arch.conf

title    Arch Linux
linux    EFI/arch/vmlinuz-linux
initrd   EFI/arch/initramfs-linux.img
options ...

I cannot change the path of linux or initrd to /boot/*.img because for some reason systemd-boot looks for these images inside /efi only. I tried updating systemd-boot with the pacman hook + enabling the systemd service for auto update.

My problem is after I run a full system upgrade, the next time I boot I end up in the emergency boot mode. I can solve this by copying everything in /boot to /efi/EFI/arch from a live USB and can boot normally.

What am I missing here? I'm sure there's some config that handles this more appropriately. I tired reading the wiki but couldn't figure out exactly what I needed.

Last edited by nikinbaidarr (2024-01-25 14:54:45)

Offline

#2 2024-01-25 03:40:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,788

Re: [SOLVED] boots to emergency mode after upgrade

It doesn't look 'inside /efi only', it looks at the ESP. If you're mounting that at /efi, why? If, for some reason, you want to do that, you need to bind mount the dir you want the kernel and initramfs in to /boot, or configure mkinitcpio to use that path, but why?

Offline

#3 2024-01-25 04:28:51

nikinbaidarr
Member
Registered: 2021-05-06
Posts: 92

Re: [SOLVED] boots to emergency mode after upgrade

Scimmia wrote:

If you're mounting that at /efi, why?

https://wiki.archlinux.org/title/EFI_sy … unt_points

you need to bind mount the dir you want the kernel and initramfs in to /boot,

https://github.com/systemd/systemd/pull … -234290236

configure mkinitcpio to use that path

I tired changing the mkinitcpio.d/linux.preset file but that didn't help. What exactly should I configure? And where?

Offline

#4 2024-01-25 04:36:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,788

Re: [SOLVED] boots to emergency mode after upgrade

I said /boot, not /boot/efi, didn't I?

The wiki link mentions both /boot and /efi; if you read the systemd-boot page, you need the kernel and initramfs on either the ESP or an XBOOTLDR partition. Again, WAY would you chose /efi when using systemd-boot without XBOOTLDR?

Last edited by Scimmia (2024-01-25 04:38:41)

Offline

#5 2024-01-25 05:00:10

nikinbaidarr
Member
Registered: 2021-05-06
Posts: 92

Re: [SOLVED] boots to emergency mode after upgrade

Scimmia wrote:

I said /boot, not /boot/efi, didn't I?

Oh okay! you mean /boot and /efi bound to a partition. Okay. That makes sense. Thank you! and also  sorry for my misunderstanding earlier.


The wiki link mentions both /boot and /efi; if you read the systemd-boot page, you need the kernel and initramfs on either the ESP or an XBOOTLDR partition. Again, WAY would you chose /efi when using systemd-boot without XBOOTLDR?

Majorly, because I also sometimes like to boot into windows 11.

Secondly, I plan on encrypting all my partitions in future.

EDIT: I'll wait till next full system upgrade to mark this as [SOLVED] for now I'll set it to [PARTIALLY-SOLVED].

Last edited by nikinbaidarr (2024-01-25 05:01:26)

Offline

#6 2024-01-25 12:37:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,384

Re: [SOLVED] boots to emergency mode after upgrade

Windows doesn't care about your linux mount points.  And when you want to "encrypt all your partitions" and if that implies you want your initramfs and bootup kernel to be encrypted as well you can forget systemd-boot outright anyway and would have to opt for GRUB or so.

Offline

Board footer

Powered by FluxBB