TL;DR After an update which included kernel updates (I use the zen kernel), I think I left my PC on for too long or something, and now boot fails with the message “failed to mount /efi” and “unknown file system type vfat” which is a symptom that there’s a difference between the installed kernel on the EFI and the kernel modules on the hard drive (if I understand it correctly).
I found this where the issue was apparently that the depmod script was not being run after kernel installs.
For me the hook and script seem to be intact, but when I run depmod (in chroot) I get :
[root@EndeavourOS ~]# depmod
depmod: ERROR: could not open directory /usr/lib/modules/6.9.6-arch1-1: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Here’s the folder in question :
[root@EndeavourOS ~]# ls /usr/lib/modules
6.10.6-arch1-1 6.10.6-zen1-1-zen 6.6.10-arch1-1
As you can see, these are all up to date. I just don’t understand why depmod is looking for older versions. I have tried running depmod 6.10.6-zen1-1-zen which seemed to work but it still didn’t boot.
And here is my EFI (normally mounted in /efi) (I don’t have a bootloader, I use EFISTUB):
Again, nothing here to suggest that kernel installation would have gone wrong. I did reinstall-kernels from chroot several times but that did not change anything.
If anyone has an idea what’s wrong, please tell me. Thanks !
For EFISTUB, I just followed the steps in https://wiki.archlinux.org/title/EFISTUB, which is really just one step : generating the UEFI entries. But it assumes vmlinuz is already there. And this did work until that kernel update so these files would have to have been generated for the previous kernel right ?
Yes. You clearly have files there. You can see them in the above output. However, we don’t generate those. I don’t know how they got there or what you did to put them there.
Unless you have knowledge to write your own custom script that automatically rebuilds a initramfs and updates the EFISTUB entry (removing the old entry and creating a new one with correct kernel name, changing boot order) directly on your motherboard without needing a third-party bootloader after every kernel update or installation.
Alright, figured it out. I still have NO IDEA what put those files there before, but I was able to add a hook to generate them on kernel upgrades with dracut by following these instructions.
That’s the thing, you don’t actually need to regenerate the EFI entry because it only points to vmlinuz-linux, which doesn’t have a version in its name. So you only needs to rebuild the initramfs, which this hook does.