You are not logged in.

#1 2022-09-17 14:11:06

astanwar99
Member
Registered: 2021-05-31
Posts: 14

[SOLVED] Failed to mount /efi after updating kernel

I recently installed arch on a new machine, everything seems to work fine except whenever kernel is updated my system throws this error after GRUB selection:

[FAILED] Failed to mount /efi. 
[DEPEND] Dependency failed for Local File Systems.

System goes into emergency mode and for some reason keyboard doesn't work.
Here are some details that might help:

[root@astanwar99 astanwar99]# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1  14.5G  0 disk 
├─sda1        8:1    1   773M  0 part 
└─sda2        8:2    1    13M  0 part 
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /efi
├─nvme0n1p2 259:2    0   910G  0 part /
└─nvme0n1p3 259:3    0    16G  0 part [SWAP]

[root@astanwar99 astanwar99]# pacman -Q linux
linux 5.19.9.arch1-1
[root@astanwar99 astanwar99]# pacman -Q linux-lts
linux-lts 5.15.68-1

[root@astanwar99 astanwar99]# ls -alh /boot
total 103M
drwxr-xr-x  3 root root 4.0K Sep 17 16:16 .
drwxr-xr-x 18 root root 4.0K Aug 16 17:38 ..
drwxr-xr-x  6 root root 4.0K Aug 16 17:50 grub
-rw-------  1 root root  34M Sep 17 16:16 initramfs-linux-fallback.img
-rw-------  1 root root 8.7M Sep 17 16:16 initramfs-linux.img
-rw-------  1 root root  32M Sep 17 16:16 initramfs-linux-lts-fallback.img
-rw-------  1 root root 8.5M Sep 17 16:16 initramfs-linux-lts.img
-rw-r--r--  1 root root  11M Sep 17 16:16 vmlinuz-linux
-rw-r--r--  1 root root  11M Sep 17 16:16 vmlinuz-linux-lts

I think that I might have messed up in this step during installation, not sure though: https://wiki.archlinux.org/title/EFI_sy … _partition
I am able to fix it by arch-chrooting using live usb and reinstalling kernel and grub:

 mount /dev/nvme0n1p1 /boot/efi  # i do this before installing grub

But I am not able to figure out how to fix it permanently.
Let me know if anything else is required. Thanks.

Last edited by astanwar99 (2022-09-25 06:24:36)

Offline

#2 2022-09-18 03:16:12

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: [SOLVED] Failed to mount /efi after updating kernel

it shouldnt really matter where the efi partition is mounted as its only used to install the grub efi file, it should not matter for a simple upgrade and in fact i used to not even have my efi partition mounted at all before i went lvm on luks and now use the efi partition for /boot.

whats actually on the /efi partition ?

ls -lah /efi

obviously make sure its mounted first.

and can you post your fstab

cat /etc/fstab

EDIT: can you also post output of

lsblk -f

Last edited by jonno2002 (2022-09-18 03:20:32)

Offline

#3 2022-09-18 12:29:29

astanwar99
Member
Registered: 2021-05-31
Posts: 14

Re: [SOLVED] Failed to mount /efi after updating kernel

Adding outputs:

➜  ~ ls -lah /efi
total 121M
drwxr-xr-x  4 root root 4.0K Jan  1  1970 .
drwxr-xr-x 18 root root 4.0K Aug 16 17:38 ..
drwxr-xr-x  4 root root 4.0K Aug 16 20:20 efi
drwxr-xr-x  6 root root 4.0K Sep 18 10:41 grub
-rwxr-xr-x  1 root root 8.7M Aug 25 19:08 initramfs-linux
-rwxr-xr-x  1 root root  34M Sep 18 10:40 initramfs-linux-fallback.img
-rwxr-xr-x  1 root root 8.7M Sep 18 10:39 initramfs-linux.img
-rwxr-xr-x  1 root root 8.5M Aug 25 19:09 initramfs-linux-lts
-rwxr-xr-x  1 root root  32M Sep 18 10:39 initramfs-linux-lts-fallback.img
-rwxr-xr-x  1 root root 8.5M Sep 18 10:39 initramfs-linux-lts.img
-rwxr-xr-x  1 root root  11M Sep 18 10:39 vmlinuz-linux
-rwxr-xr-x  1 root root  11M Sep 18 10:39 vmlinuz-linux-lts

➜  ~ tree -a /efi
/efi
├── efi
│   ├── EFI
│   │   └── GRUB
│   │       └── grubx64.efi
│   └── GRUB
│       └── grubx64.efi
├── grub                # removed its output
├── initramfs-linux
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── initramfs-linux-lts
├── initramfs-linux-lts-fallback.img
├── initramfs-linux-lts.img
├── vmlinuz-linux
└── vmlinuz-linux-lts
➜  ~ lsblk -f
NAME        FSTYPE  FSVER            LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda         iso9660 Joliet Extension ARCH_202208 2022-08-05-11-09-34-00                              
├─sda1      iso9660 Joliet Extension ARCH_202208 2022-08-05-11-09-34-00                              
└─sda2      vfat    FAT16            ARCHISO_EFI ACE9-8D8E                                           
nvme0n1                                                                                              
├─nvme0n1p1 vfat    FAT32                        7BA3-FFD9                             165.6M    45% /efi
├─nvme0n1p2 ext4    1.0                          5e66e4aa-3891-4baf-a01d-6bff34a0d77e  747.5G    11% /
└─nvme0n1p3 swap    1                            97f36c7d-765d-454b-864c-8c0bf26c89b8                [SWAP]
➜  ~ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p2
UUID=5e66e4aa-3891-4baf-a01d-6bff34a0d77e	/         	ext4      	rw,relatime	0 1

# /dev/nvme0n1p1
UUID=7BA3-FFD9      	/efi      	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/nvme0n1p3
UUID=97f36c7d-765d-454b-864c-8c0bf26c89b8	none      	swap      	defaults  	0 0

➜  ~ 

Offline

#4 2022-09-18 15:29:33

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: [SOLVED] Failed to mount /efi after updating kernel

well for a start why does /efi and /boot contain grub and initramfs files ? this is the main point of concern

and also you have the efi parition mounted to /efi in your fstab so why are you doing this:

mount /dev/nvme0n1p1 /boot/efi  # i do this before installing grub

i guess it really makes no difference cause you are just installing the grub file to the partition but theres no consistency here, things just seem to be all over the place.

Offline

#5 2022-09-19 13:26:21

astanwar99
Member
Registered: 2021-05-31
Posts: 14

Re: [SOLVED] Failed to mount /efi after updating kernel

I'll try to explain,

I reached here during installing GRUB .

Then follow the below steps to install GRUB to your disk:
1. Mount the EFI system partition and in the remainder of this section, substitute esp with its mount point.

I went with 2nd option while mounting esp.

mount ESP to /efi.
This can be useful for unified kernel images or boot loaders that have file system drivers capable of accessing the kernel(s) and files that are stored elsewhere (typically /boot).
Only the EFI binaries (the boot loader (and optionally drivers) and/or the unified kernel image) will be stored on the ESP, which saves storage space.

Which didn't work (grub didn't show up as far as I remember), so I was trying other mount points, what worked was:

mount /dev/nvme0n1p2 /mnt
mount /dev/nvme0n1p1 /mnt/boot
swapon /dev/nvme0n1p3

arch-chroot /mnt

mount /dev/nvme0n1p1 /boot/efi
pacman -S linux linux-lts
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Basically, everything went all over the place.

Now current status is:
1. My ESP is /efi/efi, because EFI directory is created there

2. Choose a bootloader identifier, here named GRUB. A directory of that name will be created in esp/EFI/ to store the EFI binary and this is the name that will appear in the UEFI boot menu to identify the GRUB boot entry.

2. I think, this can be solved using bind mount. But I am not sure what directory to bind here.

mount --bind /efi/efi/EFI/GRUB /boot

Is this correct? I am not sure what 'arch' is in documentation.

Offline

#6 2022-09-19 13:57:39

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Failed to mount /efi after updating kernel

If you want the ESP mounted under /efi run these commands from the live ISO:

mount /dev/nvme0n1p2 /mnt
mount /dev/nvme0n1p1 /mnt/efi
arch-chroot /mnt
grub-install --target=x86_64-efi --bootloader-id=Arch --efi-directory=/efi
grub-mkconfig -o /boot/grub/grub.cfg

Then use efibootmgr to delete any old, unused boot entries that might take precedence.

You might want to clear up the old kernel images on the ESP and remove the superfluous /boot/efi/ directory but it's not critical.

I think the error in the OP is because the kernel image & initramfs versions didn't match, probably due to a GRUB misconfiguration. If you had supplied the full list of commands used for installation I could be more sure. Shame you overwrote the old grub.cfg, that would have shown exactly what was happening.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB