Grub Install Error Cannot Find EFI Directory

[rogerhfcheng@rogerlinux ~]$ sudo mount /dev/nvme0n1p1 /boot/efi 
[rogerhfcheng@rogerlinux ~]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.
[rogerhfcheng@rogerlinux ~]$ sudo update-grub
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-4.19-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-x86_64.img
Found initrd fallback image: /boot/initramfs-4.19-x86_64-fallback.img
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done

Still the same error?

1 Like

Check for it now

ls -R /boot/efi | grep -i manjaro
[rogerhfcheng@rogerlinux ~]$ ls -R /boot/efi | grep -i manjaro
manjaro
/boot/efi/EFI/manjaro:

Also

efibootmgr -v
[rogerhfcheng@rogerlinux ~]$ efibootmgr -v
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,0000,0001,0003,0004,0006
Boot0000* Windows Boot Manager	HD(1,GPT,f1246fd9-5ca5-440d-ac08-4e771bdfbf7a,0x800,0x145000)/File(\EFI\boot\bootx64.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...8................
Boot0001* Diskette Drive	BBS(Floppy,Diskette Drive,0x0)..BO
Boot0002* manjaro	HD(1,GPT,f1246fd9-5ca5-440d-ac08-4e771bdfbf7a,0x800,0x145000)/File(\EFI\manjaro\grubx64.efi)
Boot0003* USB Storage Device	BBS(USB,USB Storage Device,0x0)..BO
Boot0004* CD/DVD/CD-RW Drive	BBS(CDROM,CD/DVD/CD-RW Drive,0x0)..BO
Boot0006* M.2 PCIe SSD	BBS(HD,P0: SSDPEKKF256G8 NVMe INTEL 256GB,0x0)..BO

if this is any useful

[rogerhfcheng@rogerlinux ~]$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=e7f9405a-dcc4-4daa-adac-9489077a0ffe /              ext4    defaults,noatime 0 1
UUID=4df07a2f-306d-42de-9b02-b1ef3f5f5a8a swap           swap    defaults,noatime 0 2

EFI looks proper.
Now add /boot/efi in fstab

UUID=8E7F-7DF7  /boot/efi vfat defaults,noatime 0 2

Do I put

UUID=8E7F-7DF7  /boot/efi vfat defaults,noatime 0 2

in terminal?

:scream: :scream_cat: No!!
Edit /etc/fstab file with a text editor with sudo rights and add that line

My bad, sorry.
so text file looks like this? with 2 line end with 0 2?

Sudo nano /etc/fstab?

Edited, so it is fine now?
I am a bit confused what's the difference and since it was working, how did mounting it make a difference and what type of error would that make if this was not done?


 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=e7f9405a-dcc4-4daa-adac-9489077a0ffe /              ext4    defaults,noatime 0 1
UUID=4df07a2f-306d-42de-9b02-b1ef3f5f5a8a swap           swap    defaults,noatime 0 2
UUID=8E7F-7DF7  /boot/efi vfat defaults,noatime 0 2

It looks fine. Tabs and spaces make it look awkward. You may see if you can use what is already used for other entries, but it should still be fine.
A reboot will confirm.

I'll answer that after we verify it works :wink:
Try reboot.

Rebooted, everything works fine. Will do spacing now.
Any output do you need?
Also I am hungry for the answer

  • On UEFI/efi systems, UEFI-BIOS checks on existing $esp(s) to find bootloaders
  • If it finds Manjaro grub/bootloader, it knows where to find the system and gives control to it (systemd)
  • SystemD does not need /boot/efi during boot, to successfully start everything.
  • If there is no fstab entry for $esp (/boot/efi), SystemD does not think it's an error
  • SystemD checks partitions in fstab for errors (with fsck). Here is the first miss, since a system important partition is not check on each boot, for preventive reasons.
  • If you try in the future to re-install grub, without having /boot/efi mount on the $esp partition, grub will fail, as did in your current issue.

At least those reasons I found in a quick thought.. I hope they are enough :stuck_out_tongue_winking_eye:

1 Like

I hope they are enough

More than enough.

I wont say I fully understood, but I have a rough idea. Will do more reading about EFI and OS area in general :slight_smile:
Much appreicated for your help and apologize for my noobness

1 Like

On a reboot,

Oh, os-prober error " warning: unknown device type nvme0n1." - just that os-prober (and grub) cannot parse nvme partitions, just /dev/sdxy partitions. Nothing to worry about (but yes, they should fix it).

[rogerhfcheng@rogerlinux ~]$ cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=e7f9405a-dcc4-4daa-adac-9489077a0ffe /              ext4    defaults,noatime 0 1
UUID=4df07a2f-306d-42de-9b02-b1ef3f5f5a8a swap           swap    defaults,noatime 0 2
UUID=8E7F-7DF7				              /boot/efi  	 vfat	 defaults,noatime 0 2
[rogerhfcheng@rogerlinux ~]$ efibootmgr -v
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,0000
Boot0000* Windows Boot Manager	HD(1,GPT,f1246fd9-5ca5-440d-ac08-4e771bdfbf7a,0x800,0x145000)/File(\EFI\boot\bootx64.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...8................
Boot0002* manjaro	HD(1,GPT,f1246fd9-5ca5-440d-ac08-4e771bdfbf7a,0x800,0x145000)/File(\EFI\manjaro\grubx64.efi)
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark