Grub Install Error Cannot Find EFI Directory

Hi,
I have some issues with installing Grub into my system
I am using Dell XPS 13 9360
I had a look at this post about EFI directory error, but It was not able to solve my issues. I am already not in fastboot or secure boot
I am currently running dual boot, Window 10 and Manjaro Gnome.

I am not able to boot into Grub as normal.
I am only able to get into Manjaro if I press F12 during boot, then either

- Legacy Boot -> USB Storage Device
- UEFI Boot-> UEFI: SanDisk, Partition 1

(first few step of this )

Note: I was able to boot from Legacy Boot -> M.2 PCIe SSD before but I may have accidently changed something and that give me a black screen with white cruser now.

Here is my output when I run from Legacy Boot

[rogerhfcheng@rogerlinux ~]$ sudo grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
grub-install: error: cannot find a GRUB drive for /dev/nvme0p1. Check your device.map."

Here is my output when I run from UEFI Boot

[rogerhfcheng@rogerlinux ~]$ sudo grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
[rogerhfcheng@rogerlinux ~]$ sudo grub-install /dev/nvme0n1p1
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

Here is my output for fdisk -l

Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SSDPEKKF256G8 NVMe INTEL 256GB          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DD411805-ED34-4FCE-8CD4-ADCCBD99AED0

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1333247   1331200   650M EFI System
/dev/nvme0n1p2   1333248   1595391    262144   128M Microsoft reserved
/dev/nvme0n1p3   1595392 304355327 302759936 144.4G Microsoft basic data
/dev/nvme0n1p4 472127488 474155007   2027520   990M Windows recovery environment
/dev/nvme0n1p5 474155008 497850367  23695360  11.3G Windows recovery environment
/dev/nvme0n1p6 497852416 500117503   2265088   1.1G Windows recovery environment
/dev/nvme0n1p7 409212928 451155967  41943040    20G Linux filesystem
/dev/nvme0n1p8 451155968 472127487  20971520    10G Linux swap

Partition table entries are not in disk order.


Disk /dev/sda: 14.3 GiB, 15376000000 bytes, 30031250 sectors
Disk model: Ultra T C       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot   Start     End Sectors  Size Id Type
/dev/sda1  *         64 3936807 3936744  1.9G  0 Empty
/dev/sda2       3936808 3944999    8192    4M ef EFI (FAT-12/16/32)

I also tried to set EFI from Win10 end by entering this in cmd as admin
bcedit /set {bootmgr} path \EFI\manjaro\grubx64.efi

Also tried fromthis wiki

sudo mkdir /boot/efi
mkdir: cannot create directory ‘/boot/efi’: File exists

Other maybe helpful output for

  • sudo parted -l
  • efibootmgr -v
  • findmnt -s
  • sudo blkid
    (in UEFI)
[rogerhfcheng@rogerlinux ~]$ sudo parted -l
[sudo] password for rogerhfcheng: 
Model: SanDisk Ultra T C (scsi)
Disk /dev/sda: 15.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 2      2016MB  2020MB  4194kB  primary               esp


Model: Unknown (unknown)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name                          Flags
 1      1049kB  683MB  682MB   fat32           EFI system partition          boot, esp
 2      683MB   817MB  134MB                   Microsoft reserved partition  msftres
 3      817MB   156GB  155GB                   Basic data partition          legacy_boot, msftdata
 7      210GB   231GB  21.5GB  ext4            Linux                         legacy_boot
 8      231GB   242GB  10.7GB  linux-swap(v1)  Linux Swap
 4      242GB   243GB  1038MB  ntfs                                          hidden, diag
 5      243GB   255GB  12.1GB  ntfs                                          hidden, diag
 6      255GB   256GB  1160MB  ntfs                                          hidden, diag


[rogerhfcheng@rogerlinux ~]$ efibootmgr -v
BootCurrent: 0007
Timeout: 0 seconds
BootOrder: 0000,0001,0003,0004,0006,0007
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
Boot0003* USB Storage Device	BBS(USB,SanDisk,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
Boot0007* UEFI: SanDisk, Partition 1	PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(2,0)/HD(1,MBR,0x0,0x3c1228,0x2000)..BO
[rogerhfcheng@rogerlinux ~]$ findmnt -s
TARGET SOURCE                                    FSTYPE OPTIONS
/      UUID=e7f9405a-dcc4-4daa-adac-9489077a0ffe ext4   defaults,noatime
swap   UUID=4df07a2f-306d-42de-9b02-b1ef3f5f5a8a swap   defaults,noatime
[rogerhfcheng@rogerlinux ~]$ sudo blkid
/dev/nvme0n1: PTUUID="dd411805-ed34-4fce-8cd4-adccbd99aed0" PTTYPE="gpt"
/dev/nvme0n1p1: LABEL="ESP" UUID="8E7F-7DF7" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="f1246fd9-5ca5-440d-ac08-4e771bdfbf7a"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="acecf443-a3f8-4dfb-9c9f-37bc05cbec31"
/dev/nvme0n1p3: TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="7497fbad-489f-4960-965e-f797c92176b0"
/dev/nvme0n1p4: LABEL="WINRETOOLS" UUID="04ACF084ACF07192" TYPE="ntfs" PARTUUID="1d723774-c4fc-4202-8217-40fbfaa49992"
/dev/nvme0n1p5: LABEL="Image" UUID="42F0F0CCF0F0C767" TYPE="ntfs" PARTUUID="7f145042-a2ce-45a0-a09c-2ea3e63f09e4"
/dev/nvme0n1p6: LABEL="DELLSUPPORT" UUID="68B02BC3B02B971A" TYPE="ntfs" PARTUUID="5685e68a-76b4-435b-8ca6-f08c1ad252d8"
/dev/nvme0n1p7: UUID="e7f9405a-dcc4-4daa-adac-9489077a0ffe" TYPE="ext4" PARTLABEL="Linux" PARTUUID="4d3a9a8b-e505-4e49-94ac-cbf3057bed9f"
/dev/nvme0n1p8: UUID="4df07a2f-306d-42de-9b02-b1ef3f5f5a8a" TYPE="swap" PARTLABEL="Linux Swap" PARTUUID="d2810ad1-bf72-4883-bff7-75dceea0e134"
/dev/sda1: UUID="2019-03-12-10-29-49-00" LABEL="M1804" TYPE="iso9660"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="MISO_EFI" LABEL="MISO_EFI" UUID="88F5-8C2D" TYPE="vfat"

Also, if this is any useful, when I boot from USB, I tried to detect EFI bootloaders, and within it have

(hd1.gpt1)/efi/Boot/bootx64.efi
(hd1.gpt1)/efi/Mircosoft/Boot/bootmgfw.efi
(hd1.gpt1)/efi/Mircosoft/Boot/bootmgr.efi
(hd1.gpt1)/efi/Mircosoft/Boot/bootmest.efi
(hd1.gpt1)/efi/dell/sos/bootmgfw.efi
(hd1.gpt1)/efi/dell/sos/bootmgr.efi
(hd1.gpt1)/efi/dell/sos/memtest.efi
(hd1.gpt1)/efi/dell/sos/bootx64.efi

Tried to follow this tutorial to get Grub.
Was able to follow up to mhwd-chroot. (forgot the error message, will try again)

Got more progress with the wiki Restore Grub Bootload seems to be able to complete install grub, and update grub, but doesnt seems to have any Window/Linux Image. (gave the same black/white screen like with USB Boot's after you Press C.
Message

[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.
[rogerlinux /]# update-grub
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
done

Also Tried to update outside the environment which gives image, but gives error as well

[rogerhfcheng@rogerlinux ~]$ sudo grub-install
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
[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 memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done

Restarted my Computer, tried to update agin, it works. Thanks :slight_smile:

for Grub and EFI this is :

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck

I got another error.

Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.

can you return

inxi -Fxxxz
System:    Host: rogerlinux Kernel: 4.19.32-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: Gnome 3.32.0 
           wm: gnome-shell dm: GDM 3.32.0 Distro: Manjaro Linux 
Machine:   Type: Laptop System: Dell product: XPS 13 9360 v: N/A serial: <filter> Chassis: type: 9 serial: <filter> 
           Mobo: Dell model: 0PVG6D v: A00 serial: <filter> UEFI: Dell v: 2.8.1 date: 06/14/2018 
Battery:   ID-1: BAT0 charge: 44.4 Wh condition: 57.3/60.0 Wh (95%) volts: 8.2/7.6 model: LGC-LGC7.790 DELL RNP7289 
           type: Li-ion serial: <filter> status: Unknown 
           Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M545/M546 serial: <filter> charge: 55% (should be ignored) 
           rechargeable: yes status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i5-8250U bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 6144 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 28808 
           Speed: 700 MHz min/max: 400/3400 MHz Core speeds (MHz): 1: 715 2: 746 3: 718 4: 707 5: 735 6: 793 7: 729 8: 746 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Dell driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:5917 
           Display: x11 server: X.org 1.20.4 driver: i915 compositor: gnome-shell resolution: <xdpyinfo missing> 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) v: 4.5 Mesa 19.0.1 compat-v: 3.0 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:9d71 
           Device-2: Logitech G430 Surround Sound Gaming Headset type: USB driver: hid-generic,snd-usb-audio,usbhid 
           bus ID: 3-1.3:4 chip ID: 046d:0a4d 
           Sound Server: ALSA v: k4.19.32-1-MANJARO 
Network:   Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter vendor: Bigfoot Networks driver: ath10k_pci 
           v: kernel port: f040 bus ID: 3a:00.0 chip ID: 168c:003e 
           IF: wlp58s0 state: up mac: <filter> 
           Device-2: Qualcomm Atheros type: USB driver: btusb bus ID: 1-3:3 chip ID: 0cf3:e300 
Drives:    Local Storage: total: 238.47 GiB used: 9.91 GiB (4.2%) 
           ID-1: /dev/nvme0n1 model: SSDPEKKF256G8 NVMe INTEL 256GB size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 
           serial: <filter> rev: D05N scheme: GPT 
Partition: ID-1: / size: 19.56 GiB used: 9.91 GiB (50.7%) fs: ext4 dev: /dev/nvme0n1p7 
           ID-2: swap-1 size: 10.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p8 
Sensors:   System Temperatures: cpu: 50.5 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 225 Uptime: 44m Memory: 7.52 GiB used: 1.46 GiB (19.4%) Init: systemd v: 241 Compilers: gcc: N/A 
           Shell: bash v: 5.0.2 running in: gnome-terminal inxi: 3.0.32 

on boot with USB install you have selected
USB ( bios boot )
UEFI USB partition 1 ( EFI boot )

i have found

Boot0007* UEFI: SanDisk, Partition 1	PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(2,0)/HD(1,MBR,0x0,0x3c1228,0x2000)

@gohlip , UEFI that start on MBR , mean booting on part 1 boot not part 2 esp ?

Yea, because if I dont boot from USB, I am unable to boot into linux. The boot order believe I can change from bios to make that after

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................

Edit: If boot from windowsBootManger, will boot into window directly (as expected)?

it's just install Grub & EFI manjaro in boot process
@gohlip will help you

1 Like

Thank you for the direction. I spend a few hours focusing into installing Grub and I got it working now. Thanks again :slight_smile:

Good to hear.
Do you now have a /boot/efi in fat32 and mounted at fstab?
You did not have earlier. If unsure and to check, at manjaro terminal ..

cat /etc/fstab
efibootmgr -v

Welcome to Manjaro.

3 posts were split to a new topic: Messed up my EFI partition

I think I do? (At least for the first part).
Attached output below, Correct me if I am wrong on the following statement as well?

  1. I currently have those two partition (swap and ext4 file) mounted at "/" and "swap" which are within fstab?
  2. At the same time, I have my Grub in my EFI System Partition (which will mount during boot and un-mount after enter Manjaro?)
[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
[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

This is the wrong part (assumption).
You should also have /boot/efi (esp) in fstab, so it will not "unmount" after boot.

so should cat /etc/fstab out put have an extra row of output? and I am missing something in my system? If so, what area of fix should I be looking into?

Yes. The esp at /boot/efi

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

As petsam says, you do not have a $esp in your fstab entry.
You will need to put in this at fstab

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

Then after putting into fstab, at terminal....

sudo mount /dev/nvme0n1p1 /boot/efi
sudo grub-install 
sudo update-grub
sudo cp /boot/grub/x86_64-efi/core.efi /boot/efi/EFI/boot/bootx64.efi

If the first command results in an output that states /boot/efi is already mounted, verify with

findmnt /boot/efi

and the result must show /dev/nvme0n1p1 and continue with the 2nd, third and forth commands.

@petsam,
A strange case of not having a /boot/efi entry in fstab and yet having a 'manjaro' entry (/dev/nvme0n1p1) at 'efibootmgr -v'. I'm a latecomer to this topic, but reading quickly, how did that happen? I ask OP to check fstab as I did not see anywhere he did that. His grub-install does not specify that either, or did he and I missed that?

Oh.. you sent out you last post as I was typing. But ...please look into this.

@Bulaxy, fstab entry best to have '0 0 ' instead of '0 2' but either will work. I think '0 0' is better.

I dont think I was able to update grub. the same error that bug me the whole day

[rogerhfcheng@rogerlinux ~]$ sudo grub-install
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
[rogerhfcheng@rogerlinux ~]$ sudo cp /boot/grub/x86_64-efi/core.efi /boot/efi/EFI/boot/bootx64.efi

Okay try again with

sudo grub-install --no-nvram

Make sure /dev/nvme0n1p1 is mounted as /boot/efi first.

so...
findmnt /boot/efi
givves output of /dev/nvme0n1p1? If yes, do command.
If no, mount that first and do command.
sudo mount /dev/nvme0n1p1 /boot/efi
sudo grub-install --no-nvram

Have you mounted the fat32 partition first?

1 Like

Good point!

So @Bulaxy, mount $esp first
do the 'sudo grub-install' without --no-nvram
and if same error, do the command with --no-nvram

[EDIT] - and tell us. :grinning:

1 Like