Grub install real error cannot find efi directory

I never had the following problem when I used to install Arch on an HDD.

#1 2020-01-10 16:42:32

light9876
Member
Registered: 2020-01-05
Posts: 108

[SOLVED] grub-install: error «cannot find EFI directory»

I never had the following problem when I used to install Arch on an HDD.

But not on my new SSD, this is what I’m doing (note that when I do fdisk -l I can see the SSD has a GPT partitioning table):

1. I have been reading the following guides all day (and I’m following them):
https://wiki.archlinux.org/index.php/Installation_guide
https://wiki.archlinux.org/index.php/Partitioning
https://wiki.archlinux.org/index.php/Arch_boot_process

2. cgdisk /dev/sda and I create 3 partitions:
sda1; 2GB, code:ef00, name=efi
sda2; 200GB, code:8300, name=root
sda3; ~750GB, code:8302, name=home

3. I format all 3 partitions:
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3

4. Mount root:
mount /dev/sda2 /mnt

5. Install base:
pacstrap /mnt base base-devel linux grub efibootmgr
mkinitcpio -p linux

6. : All of the following commands give the same error: grub-install: error «cannot find EFI directory»
grub-install /dev/sda
grub-install —target=x86_64-efi /dev/sda
grub-install —efi-directory=/boot/efi —target=x86_64-efi /dev/sda

Can someone tell me what I am doing wrong please?

Last edited by light9876 (2020-01-10 18:37:40)

#2 2020-01-10 17:09:51

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,876
Website

Re: [SOLVED] grub-install: error «cannot find EFI directory»

You forgot to mount the EFI system partition, it should be FAT-formatted (not ext4) and you should (arch-)chroot in before running the GRUB commands.

Step 4 should be

# mount /dev/sda2 /mnt
# mkdir -p /mnt/boot/efi
# mount /dev/sda1 /mnt/boot/efi

And step 6 should start with

Note that the UEFI grub-install command doesn’t need a block device.

EDIT: and the mkinitcpio command should be run from the chroot (although you probably don’t need to run it at all).

Last edited by Head_on_a_Stick (2020-01-10 17:11:24)

#3 2020-01-10 17:15:38

light9876
Member
Registered: 2020-01-05
Posts: 108

Re: [SOLVED] grub-install: error «cannot find EFI directory»

Thank you, I will try this immediately!

I am already doing arch-chroot /mnt but I forgot to mention it.

I will try now to format correctly and to mount /mnt/boot/efi

Last edited by light9876 (2020-01-10 17:15:58)

#4 2020-01-10 18:46:02

light9876
Member
Registered: 2020-01-05
Posts: 108

Re: [SOLVED] grub-install: error «cannot find EFI directory»

Thank you so much everything works okay now!

Only for future reference: the information you provided is written here:
https://wiki.archlinux.org/index.php/GR … allation_2

One final question:
I installed lxde and lxdm; then I logged in my user account. Now the partition /dev/sda3 that I created for /home, is not mounted at /home.

Instead, /home directory and all of its contents are resident on /dev/sda2

How can I fix this please?

Last edited by light9876 (2020-01-10 18:46:36)

#5 2020-01-10 18:58:31

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,876
Website

Re: [SOLVED] grub-install: error «cannot find EFI directory»

light9876 wrote:

How can I fix this please?

Create an fstab line to mount /home correctly then move the contents over to the new partition.

If you need more help with that then please open a new thread, it is off-topic here.

#6 2020-01-10 20:09:57

light9876
Member
Registered: 2020-01-05
Posts: 108

Re: [SOLVED] grub-install: error «cannot find EFI directory»

Thank you so much! I am very happy with the generous support you and everyone else have given me! : ) God bless you!

Last edited by light9876 (2020-01-10 20:10:39)

This article documents issues that might arise when trying to use or install GRUB2.

Installation errors

Installing GRUB2 from within a chroot

When a separate /boot partition exists, be sure to mount the target root partition before chrooting, but do not mount the /boot partition until after chrooting to the new environment. This is required because grub-mkconfig will not detect /boot as a separate partition and will assume the /boot directory and the root (/) directory are on the same partition.

Reinstalling the GRUB2 EFI boot manager entry

In case the boot manager entries need to be restored, they can be re-added without invoking grub-install. Load the efivars kernel module and install sys-boot/efibootmgr:

root #emerge --ask sys-boot/efibootmgr

Next add a boot menu entry:

root #efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "gentoo" --loader "\EFI\gentoo\grubx86.efi"

grub-install: error: cannot find EFI directory.

Note
The following examples presumes a 64-bit EFI GRUB2 install, adjust accordingly for 32-bit EFI.

root #grub-install --target=x86_64-efi

grub-install: error: cannot find EFI directory.

Properly setting the GRUB_PLATFORMS variable in /etc/portage/make.conf (the first time!) as listed above should resolve this error. Set the GRUB_PLATFORMS variable then re-emerge GRUB2 using the following command:

root #emerge --ask --newuse sys-boot/grub:2

In the case this error persists try forcing the install to the EFI directory by issuing the grub-install command with correct parameters for the --target and --efi-directory options:

root #grub-install --target=x86_64-efi --efi-directory=/boot

grub-install: Attempting to install GRUB2 to a disk or partition

root #grub-install /dev/sda1

Attempting to install GRUB to a partition disk or to a partition.  This is a BAD idea.
Embedding is not possible.  GRUB can only be installed in this setup by using blocklists. 
However, blocklists are UNRELIABLE and their use is discouraged.

There could be many reasons for this error to come up.

No mounted /boot

A /boot partition is not mounted.

No BIOS boot partition while using BIOS-GPT setup

This could mean there is not a EF02 or bios_boot partition to embed the core.img file in.

Creating a little partition of a few hundreds kilobytes may be enough, although it is good practice to align this partition to 2048 sectors to avoid a performance penalty with the disk. A 1 MiB partition should work well.

Attempting to install GRUB2 in a partition

When attempting to install GRUB2 in a partition e.g. /dev/sda5 (for instance because the boot loader will be chainloaded by a different boot loader), simply add --force option switch to force install.

Missing target detection

If grub-install does not print any errors message or if the error message is about scanning disk files and several platforms are enabled in /etc/portage/make.conf while nothing is installed on the disk, then edit the /sbin/grub-install script with a text editor of choice.

Change the platform variable to the appropriate platform for the current use case. The platform must be rightly set when emerging sys-boot/grub, else it will be incorrectly configured in the /sbin/grub-install script.

For example, to set the platform for «PC», change platform=qemu to platform=pc.

Note
This is true for GRUB version 1.99x only… for GRUB2 the correct file to investigate can be found at /etc/grub.d/00_header; change transform="s,grub,grub-qemu," to transform="s,grub,grub2," for instance to install rightly with grub-$platform-install.

grub-setup: no post-MBR gap

root #grub-bios-setup

grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!
grub-bios-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.
            However, blocklists are UNRELIABLE and its use is discouraged.
grub-bios-setup: error: If you really want blocklists, use --force.

This error means that GRUB2 could not find the usual gap between the MBR and first partition of a disk. It is possible that the gap does not exist. Some tools (e.g. LiveUSB disk installer) format disks so that the first partition starts at sector 1 instead of 2048.

Repartitioning might be necessary to resolve the issue.

grub-install: embedding area is unusually small

root #grub-install /dev/sda

grub-install: warn: Your embedding area is unusually
small. core.img won't fit in it.
grub-install: warn: Embedding is not possible. GRUB can
only be installed in this setup by using blocklists. However,
blocklists are UNRELIABLE and their use is discouraged.
grub-install: error: will not proceed with blocklists.

There is not enough room at the beginning of the disk before the first partition.

In general this is a bit of trouble to fix. One or more partitions need to be resized in order to leave some free space at the beginning of the drive. The GParted LiveCD or SystemRescueCD are excellent tools to make this job less difficult.

If the swap partition is the first partition on the disk (e.g. /dev/sda1) it is possible to simply remove the existing swap space partition and re-partition the space. This resolution would avoid the need for booting into a live medium in order to resize a root (/) partition.

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

User avatar

farkas

Level 5
Level 5
Posts: 553
Joined: Mon Sep 21, 2015 6:10 pm
Location: Oregon

[Solved] grub-install, real: error: cannot find EFI directory

At the end of running Update Manager I get an error message.
So far it has not caused any other problems, everything else is working.
I upgrade to Mint 19 from 18.3 and it went smoothly.
I’m attaching screen shots of the error messages.

Attachments
Screenshot from 2018-09-02 14-39-41.png
Screenshot from 2018-09-02 14-39-01.png

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.

Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

If your query has been resolved, edit your first post and add [SOLVED] to the subject line.
If you found a solution on your own please post it.
A generation which ignores history has no past and no future.

gm10

Level 20
Level 20
Posts: 10480
Joined: Thu Jun 21, 2018 5:11 pm

Re: grub-install, real: error: cannot find EFI directory

Post

by gm10 » Thu Sep 20, 2018 2:08 am

Go Mint menu > Disks and find the partition with Partition Type: EFI System and make sure it is mounted and gets mounted at system startup (cogs icon > edit mount options) as /boot/efi, then try again.

If there is any doubt, copy & paste the output of these terminal commands into your next post and we’ll talk you through it:

User avatar

farkas

Level 5
Level 5
Posts: 553
Joined: Mon Sep 21, 2015 6:10 pm
Location: Oregon

Re: grub-install, real: error: cannot find EFI directory

Post

by farkas » Thu Sep 20, 2018 2:32 am

Here is a screen shot of Mount Options and the outputs of the commands

steve@steve ~ $ inxi -Fxzp
System: Host: steve Kernel: 4.15.0-33-generic x86_64 bits: 64 gcc: 7.3.0
Desktop: Cinnamon 3.8.9 (Gtk 3.22.30-1ubuntu1)
Distro: Linux Mint 19 Tara
Machine: Device: desktop System: ASUS product: All Series serial: N/A
Mobo: ASUSTeK model: Z97-A-USB31 v: Rev 1.xx serial: N/A
UEFI: American Megatrends v: 2501 date: 06/24/2015
Battery hidpp__0: charge: N/A condition: NA/NA Wh
model: Logitech Wireless Mouse M325 status: Discharging
CPU: Quad core Intel Core i5-4690K (-MCP-)
arch: Haswell rev.3 cache: 6144 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 28002
clock speeds: max: 4300 MHz 1: 4300 MHz 2: 4298 MHz 3: 4274 MHz
4: 4300 MHz
Graphics: Card: NVIDIA GM206 [GeForce GTX 950] bus-ID: 01:00.0
Display Server: x11 (X.Org 1.19.6 )
drivers: nouveau (unloaded: modesetting,fbdev,vesa)
Resolution: 1920×1080@60.00hz
OpenGL: renderer: NV126 version: 4.3 Mesa 18.0.5 Direct Render: Yes
Audio: Card-1 NVIDIA Device 0fba driver: snd_hda_intel bus-ID: 01:00.1
Card-2 Intel 9 Series Family HD Audio Controller
driver: snd_hda_intel bus-ID: 00:1b.0
Sound: Advanced Linux Sound Architecture v: k4.15.0-33-generic
Network: Card: Intel Ethernet Connection (2) I218-V
driver: e1000e v: 3.2.6-k port: f040 bus-ID: 00:19.0
IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives: HDD Total Size: 1256.3GB (33.4% used)
ID-1: /dev/sda model: MKNSSDRE256GB size: 256.1GB
ID-2: /dev/sdb model: WDC_WD10EZEX size: 1000.2GB
Partition: ID-1: / size: 219G used: 52G (25%) fs: ext4 dev: /dev/sda2
ID-2: /mnt/bace1082-0403-40df-8db4-73a49b3f9f64 size: 917G used: 325G (38%)
fs: ext4 dev: /dev/sdb1
ID-3: swap-1 size: 17.11GB used: 0.00GB (0%)
fs: swap dev: /dev/sda3
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 29.8C mobo: 27.8C
Fan Speeds (in rpm): cpu: 0
Info: Processes: 198 Uptime: 6:54 Memory: 7135.6/15977.1MB
Init: systemd runlevel: 5 Gcc sys: 7.3.0
Client: Shell (bash 4.4.191) inxi: 2.3.56
steve@steve ~ $ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 vfat 9EC0-DA7D
├─sda2 ext4 f4ea408c-2077-401a-b2e6-1ce1a4298856 /
└─sda3 swap 8f32a8ce-e0bd-463a-b4c1-911961d36c44 [SWAP]
sdb
└─sdb1 ext4 bace1082-0403-40df-8db4-73a49b3f9f64 /mnt/bace1082-0403-40df
sr0
steve@steve ~ $ 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>
# / was on /dev/sda2 during installation
UUID=f4ea408c-2077-401a-b2e6-1ce1a4298856 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
# swap was on /dev/sda3 during installation
UUID=8f32a8ce-e0bd-463a-b4c1-911961d36c44 none swap sw 0 0
/dev/disk/by-id/usb-_USB_Flash_Memory_CC52AF4C82BECDC1B4AA7560-0:0-part1 /mnt/usb-_USB_Flash_Memory_CC52AF4C82BECDC1B4AA7560-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/bace1082-0403-40df-8db4-73a49b3f9f64 /mnt/bace1082-0403-40df-8db4-73a49b3f9f64 auto nosuid,nodev,nofail,x-gvfs-show 0 0
steve@steve ~ $ df -h /boot/efi
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 219G 52G 156G 25% /
steve@steve ~ $

Attachments
Screenshot from 2018-09-19 23-25-19.png

If your query has been resolved, edit your first post and add [SOLVED] to the subject line.
If you found a solution on your own please post it.
A generation which ignores history has no past and no future.

gm10

Level 20
Level 20
Posts: 10480
Joined: Thu Jun 21, 2018 5:11 pm

Re: grub-install, real: error: cannot find EFI directory

Post

by gm10 » Thu Sep 20, 2018 2:51 am

Excellent. Instead of talking you through using the Disks tool, I’ll just give you a bunch of stuff to copy & paste, usually safer. So in a terminal run:

authenticate and then replace the entire contents with this:

Code: Select all

# /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>
# / was on /dev/sda2 during installation
UUID=f4ea408c-2077-401a-b2e6-1ce1a4298856 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=9EC0-DA7D	/boot/efi	vfat	umask=0077	0	1
# swap was on /dev/sda3 during installation
UUID=8f32a8ce-e0bd-463a-b4c1-911961d36c44 none swap sw 0 0
/dev/disk/by-id/usb-_USB_Flash_Memory_CC52AF4C82BECDC1B4AA7560-0:0-part1 /mnt/usb-_USB_Flash_Memory_CC52AF4C82BECDC1B4AA7560-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/bace1082-0403-40df-8db4-73a49b3f9f64 /mnt/bace1082-0403-40df-8db4-73a49b3f9f64 auto nosuid,nodev,nofail,x-gvfs-show 0 0

Save and exit, then run

and finally

You should now be able to install the updates that previously failed, now and in the future.

User avatar

farkas

Level 5
Level 5
Posts: 553
Joined: Mon Sep 21, 2015 6:10 pm
Location: Oregon

Re: grub-install, real: error: cannot find EFI directory

Post

by farkas » Thu Sep 20, 2018 3:19 am

Thanks!
I followed your instructions and rebooted. No problem. I’ll let you know if they work when new updates are available.

It worked, again thank for your help!

If your query has been resolved, edit your first post and add [SOLVED] to the subject line.
If you found a solution on your own please post it.
A generation which ignores history has no past and no future.

Содержание

  1. GRUB/Troubleshooting
  2. Содержание
  3. Installation errors
  4. Installing GRUB2 from within a chroot
  5. Reinstalling the GRUB2 EFI boot manager entry
  6. grub-install: error: cannot find EFI directory.
  7. grub-install: Attempting to install GRUB2 to a disk or partition
  8. No mounted /boot
  9. No BIOS boot partition while using BIOS-GPT setup
  10. Attempting to install GRUB2 in a partition
  11. Missing target detection
  12. grub-setup: no post-MBR gap
  13. grub-install: embedding area is unusually small
  14. Arch Linux
  15. #1 2015-12-29 20:25:38
  16. [Solved] Trouble installing GRUB, can’t find EFI directory
  17. #2 2015-12-29 20:34:57
  18. Re: [Solved] Trouble installing GRUB, can’t find EFI directory
  19. #3 2015-12-29 20:46:56
  20. Re: [Solved] Trouble installing GRUB, can’t find EFI directory
  21. #4 2015-12-29 20:50:40
  22. Re: [Solved] Trouble installing GRUB, can’t find EFI directory
  23. #5 2015-12-29 20:54:12
  24. Re: [Solved] Trouble installing GRUB, can’t find EFI directory
  25. #6 2015-12-29 20:57:18
  26. Re: [Solved] Trouble installing GRUB, can’t find EFI directory
  27. Thread: GRUB Install Error: Cannot find EFI directory
  28. GRUB Install Error: Cannot find EFI directory
  29. Re: GRUB Install Error: Cannot find EFI directory
  30. Re: GRUB Install Error: Cannot find EFI directory
  31. Re: GRUB Install Error: Cannot find EFI directory
  32. Re: GRUB Install Error: Cannot find EFI directory
  33. Re: GRUB Install Error: Cannot find EFI directory
  34. Re: GRUB Install Error: Cannot find EFI directory
  35. Re: GRUB Install Error: Cannot find EFI directory
  36. Arch Linux
  37. #1 2018-09-19 17:20:30
  38. [solved] Grub cannot find EFI directory
  39. #2 2018-09-19 17:32:44
  40. Re: [solved] Grub cannot find EFI directory
  41. #3 2018-09-19 17:41:01
  42. Re: [solved] Grub cannot find EFI directory
  43. #4 2018-09-19 17:48:22
  44. Re: [solved] Grub cannot find EFI directory
  45. #5 2018-09-19 17:50:48
  46. Re: [solved] Grub cannot find EFI directory
  47. #6 2018-09-19 17:52:21
  48. Re: [solved] Grub cannot find EFI directory
  49. #7 2018-09-19 17:59:34
  50. Re: [solved] Grub cannot find EFI directory
  51. #8 2018-09-19 18:30:25
  52. Re: [solved] Grub cannot find EFI directory
  53. #9 2018-09-19 18:32:05
  54. Re: [solved] Grub cannot find EFI directory
  55. #10 2018-09-19 18:34:03
  56. Re: [solved] Grub cannot find EFI directory
  57. #11 2018-09-19 18:37:35
  58. Re: [solved] Grub cannot find EFI directory
  59. #12 2018-09-19 18:39:25
  60. Re: [solved] Grub cannot find EFI directory
  61. #13 2018-09-19 18:51:24
  62. Re: [solved] Grub cannot find EFI directory
  63. #14 2018-09-19 18:57:33
  64. Re: [solved] Grub cannot find EFI directory

GRUB/Troubleshooting

This article documents issues that might arise when trying to use or install GRUB2.

Содержание

Installation errors

Installing GRUB2 from within a chroot

When a separate /boot partition exists, be sure to mount the target root partition before chrooting, but do not mount the /boot partition until after chrooting to the new environment. This is required because grub-mkconfig will not detect /boot as a separate partition and will assume the /boot directory and the root ( / ) directory are on the same partition.

Reinstalling the GRUB2 EFI boot manager entry

In case the boot manager entries need to be restored, they can be re-added without invoking grub-install . Load the efivars kernel module and install sys-boot/efibootmgr:

Next add a boot menu entry:

grub-install: error: cannot find EFI directory.

Properly setting the GRUB_PLATFORMS variable in /etc/portage/make.conf (the first time!) as listed above should resolve this error. Set the GRUB_PLATFORMS variable then re-emerge GRUB2 using the following command:

In the case this error persists try forcing the install to the EFI directory by issuing the grub-install command with correct parameters for the —target and —efi-directory options:

grub-install: Attempting to install GRUB2 to a disk or partition

There could be many reasons for this error to come up.

No mounted /boot

A /boot partition is not mounted.

No BIOS boot partition while using BIOS-GPT setup

This could mean there is not a EF02 or bios_boot partition to embed the core.img file in.

Creating a little partition of a few hundreds kilobytes may be enough, although it is good practice to align this partition to 2048 sectors to avoid a performance penalty with the disk. A 1 MiB partition should work well.

Attempting to install GRUB2 in a partition

When attempting to install GRUB2 in a partition e.g. /dev/sda5 (for instance because the boot loader will be chainloaded by a different boot loader), simply add —force option switch to force install.

Missing target detection

If grub-install does not print any errors message or if the error message is about scanning disk files and several platforms are enabled in /etc/portage/make.conf while nothing is installed on the disk, then edit the /sbin/grub-install script with a text editor of choice.

Change the platform variable to the appropriate platform for the current use case. The platform must be rightly set when emerging sys-boot/grub, else it will be incorrectly configured in the /sbin/grub-install script.

For example, to set the platform for «PC», change platform=qemu to platform=pc .

grub-setup: no post-MBR gap

This error means that GRUB2 could not find the usual gap between the MBR and first partition of a disk. It is possible that the gap does not exist. Some tools (e.g. LiveUSB disk installer) format disks so that the first partition starts at sector 1 instead of 2048.

Repartitioning might be necessary to resolve the issue.

grub-install: embedding area is unusually small

There is not enough room at the beginning of the disk before the first partition.

In general this is a bit of trouble to fix. One or more partitions need to be resized in order to leave some free space at the beginning of the drive. The GParted LiveCD or SystemRescueCD are excellent tools to make this job less difficult.

Источник

Arch Linux

You are not logged in.

#1 2015-12-29 20:25:38

[Solved] Trouble installing GRUB, can’t find EFI directory

Hi guys, first post on here.
I’m trying to install arch using a USB to boot, on a UEFI system using a MBR partition table. I’ve attempted it several times, but always end up starting by deleting my linux partitions and rebooting. My partitions look like this:

sda1 — partition i’m too afraid to touch that was already there
sda2 — main windows partition
sda3 — partition i’m too afraid to touch that was already there (x2)
sda4 — extended
—sda5 root 90G
—sda6 boot 512M
—sda7 home 104G

I think something goes wrong when I create my partitions. I don’t use parted, because quite frankly it confuses me and I’m too afraid that I’ll delete my windows data. Instead, I use cfdisk and I think I miss a few steps. sda6 is set as Bootable, and its type is EFI (Fat-12/16/32). Is that all? The filesystem is set as fat32 using mkfs.fat -F32 /dev/sdxY

When I run the # grub-install —recheck /dev/sda command it just says that it can’t find the EFI directory. Isn’t this /boot? I then did
grub-install —recheck —efi-directory=/boot /dev/sda
which results in
Installing for x86_64-efi platform.
grub-install: error: efibootmgr: not found.
and then nothing happens.

How do I install GRUB successfully in this situation? Sorry for any noobishness, and thanks in advance!

Last edited by Piexes (2015-12-29 21:49:01)

#2 2015-12-29 20:34:57

Re: [Solved] Trouble installing GRUB, can’t find EFI directory

Presuming that Windows is installed in UEFI mode, you will need to share the Windows-generated EFI system partition (sda3?) and mount that to /boot

Use `gdisk -l /dev/sda` to find the EFI system partition.

Post the output of that command if you’re not 100% sure.

EDIT: Just out of curiosity, why are you using GRUB?

Most newbies seem to prefer it in spite of the fact that the Beginner’s Guide has instructions for systemd-boot in UEFI systems.

You are following the Beginner’s Guide, right?

EDIT2: Just to clarify: I think you have created a GNU/Linux partition type (8300) at /dev/sda6 and formatted in to FAT32 when you actually need a specific EFI system partition type (EF00) for GRUB to install successfully.

Last edited by Head_on_a_Stick (2015-12-29 20:39:07)

#3 2015-12-29 20:46:56

Re: [Solved] Trouble installing GRUB, can’t find EFI directory

I was following this section, but I guess I’ll try to go and do the systemd one. I’ll edit/post with an update.
The output of that command:
http://imgur.com/MXipX1K

Edit: I tried running bootctl install, and it spat out:
File system «/boot» is not on a GPT partition table
hmm
lsblk still shows me that sda6 is still mounted at mountpoint /mnt/boot
it’s fat32 for sure
The wiki says that the boot partition needs gdisk type EF00. I doubt I did this.

Last edited by Piexes (2015-12-29 20:52:22)

#4 2015-12-29 20:50:40

Re: [Solved] Trouble installing GRUB, can’t find EFI directory

Right, sorry, my mistake — you are *not* using a UEFI system (or a GPT disk) so you should be following the non-UEFI instructions:
https://wiki.archlinux.org/index.php/Be … BIOS.2FMBR

Also, in this case, /boot should probably use a POSIX-compliant filesystem rather than FAT.

Last edited by Head_on_a_Stick (2015-12-29 20:54:12)

#5 2015-12-29 20:54:12

Re: [Solved] Trouble installing GRUB, can’t find EFI directory

Ok, now I’m pretty confused. The wiki tells me to run ls /sys/firmware/efi/efivars and if it’s populated I’m in UEFI mode. It’s definitely populated, it spits out a ton of stuff.
Should I reinstall the .iso again on my flashdrive and delete the linux partitions for a completely fresh start?

Last edited by Piexes (2015-12-29 20:55:53)

#6 2015-12-29 20:57:18

Re: [Solved] Trouble installing GRUB, can’t find EFI directory

It’s definitely populated, it spits out a ton of stuff.

Yes you may be booted in UEFI mode but your Windows system appears to be installed in non-UEFI mode — there is no EFI system partition present.

If you wish to be able to switch between the two without toggling «Legacy» mode, you must install Arch in non-UEFI mode also.

It may be that a UEFI-installed GRUB can actually boot a non-UEFI Windows system if you create the requisite EFISYS partition but I don’t know and have of way of testing.

EDIT: You can attempt to force GRUB to install a non-UEFI loader with:

EDIT2: Can you check from Windows if it is booted in UEFI mode?

Last edited by Head_on_a_Stick (2015-12-29 21:33:31)

Источник

Thread: GRUB Install Error: Cannot find EFI directory

Thread Tools
Display

GRUB Install Error: Cannot find EFI directory

Hi everyone,
I have a dual boot, 64 bit laptop with Windows 8 on one partition and Ubuntu 14.04 on the other. Windows recently updated and now GNU GRUB no longer appears when I boot my computer. I found information on the following website on how to repair it: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
This worked fine until I got to this command:

or something like that.
Could someone please help me get GRUB back so I can use Ubuntu again please?
Thanks in advance.

Last edited by Kpenguin; April 9th, 2015 at 03:44 PM .

Re: GRUB Install Error: Cannot find EFI directory

Your link is to the full chroot (CHange ROOT) to use the kernel from live installer, but be working in your system. But it is a bit older for BIOS based systems. You also have to mount the efi partition and any other system partitions that some have as separate partitions. You should just need to add a mount of the efi partition.

Usually most desktops do not have separate partitions for other system folders, a few do have separate /boot but that is not recommended for most desktops.

But often easier to use Boot-Repair.

Boot Repair -Also handles LVM, GPT, separate /boot and UEFI dual boot.:
Precise, Trusty, Vivid, & Utopic all should work now with current ppa
https://help.ubuntu.com/community/Boot-Repair

Re: GRUB Install Error: Cannot find EFI directory

Use the Ubuntu installation CD/flash drive (or any Linux) and go to the boot repair site, download and run it selecting the option to Create Boot Info Summary. Post the output text file here as it will have more detailed information on your system(s).

Re: GRUB Install Error: Cannot find EFI directory

Hi,
I tried the boot repair application and it worked great! I now have GRUB and Ubuntu back.This is rather minor, but I now also have a bunch of other stuff that wasn’t there before (see attached screenshot).
SAM_0463.JPG
I previously just had Ubuntu, Advanced options for Ubuntu, Windows boot manager, and System setup. Is there some way to get rid of the stuff in between?
Again, this is minor and not vital
Thanks for your help!

Re: GRUB Install Error: Cannot find EFI directory

HP seems to have a lot of its recovery/repair files as efi files in the standard efi(ESP) partition. So Boot-Repair just adds them to the grub menu.
Boot-Repair normally creates a new 25_custom folder. That is just from Boot-Repair so you can edit at will.

Just to have a backup.
sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
Edit :
gksudo gedit /etc/grub.d/25_custom
Or:
sudo nano /etc/grub.d/25_custom
Then do:
sudo update-grub

Re: GRUB Install Error: Cannot find EFI directory

So, I need to follow those steps and then re-run boot manager, or just update GRUB?

Re: GRUB Install Error: Cannot find EFI directory

Just the steps shown.
Boot-Repair would probably add them back again.

Re: GRUB Install Error: Cannot find EFI directory

Wow. That was easy. Thanks for your help!

Источник

Arch Linux

You are not logged in.

#1 2018-09-19 17:20:30

[solved] Grub cannot find EFI directory

When using «grub-install» I always get «grub-install: error: cannot find EFI directory»

A couple of month ago I could just use grub-install without any error and I didn’t change any hardware since then

«LS /sys/firmware/EFI/efivars» returns a whole bunch of files.

I tried creating a partition on a GPT drive with the type EFI system out of desperation but can’t mount it to /mnt/boot. I am getting this error
mount: /mnt/boot: wrong fs type, bad option, bad superblocks on /dev/sdc2, missing codepage or helper program, or other error

I have no clue what to do now. I’ve been trying to partition differently a couple of times but nothing worked.

Last edited by Belph (2019-01-05 19:40:14)

#2 2018-09-19 17:32:44

Re: [solved] Grub cannot find EFI directory

What guide are you following to install Arch?

Please post the output of

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#3 2018-09-19 17:41:01

Re: [solved] Grub cannot find EFI directory

Oof, I don’t know how to post the output here without typing it in. But it shows me that the partition table is loop and not GPT. I assume that is he important information there, right?

#4 2018-09-19 17:48:22

Re: [solved] Grub cannot find EFI directory

I suspect that loop device will be the iso you are booted into.

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#5 2018-09-19 17:50:48

Re: [solved] Grub cannot find EFI directory

I suspect that loop device will be the iso you are booted into.

If you mean if that is the USB stick that I am booted it right now, then no, that one has msdos as partition table.

It is actually the SSD I want to install Arch on that has loop as partition table.

#6 2018-09-19 17:52:21

Re: [solved] Grub cannot find EFI directory

#7 2018-09-19 17:59:34

Re: [solved] Grub cannot find EFI directory

Model: ATA HGST HTS545050A7 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0.00B 500GB 500GB ext4

Model: ATA TOSHIBA DT01ACA1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0.00B 1000GB 1000GB ext4

Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sdc: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0.00B 120GB 120GB ext4

Model: Sony Storage Media (scsi)
Disk /dev/sde: 7801MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 7801MB 7800MB primary fat32 boot, lba

#8 2018-09-19 18:30:25

Re: [solved] Grub cannot find EFI directory

Also, you forgot to answer my earlier question:

What guide are you following to install Arch?

That may well answer my next question: do you know how you ended up with loop partition tables on all but one of your physical disks?

Please also post the output of

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#9 2018-09-19 18:32:05

Re: [solved] Grub cannot find EFI directory

Also, you forgot to answer my earlier question:

What guide are you following to install Arch?

That may well answer my next question: do you know how you ended up with loop partition tables on all but one of your physical disks?

Please also post the output of

I am sorry, I’ve been using the Arch Installation guide here on the website. And for grub just the wiki page about grub.

I have no clue how they all became loop.

#10 2018-09-19 18:34:03

Re: [solved] Grub cannot find EFI directory

Also, you forgot to answer my earlier question:

What guide are you following to install Arch?

That may well answer my next question: do you know how you ended up with loop partition tables on all but one of your physical disks?

Please also post the output of

I am sorry, I’ve been using the Arch Installation guide here on the website. And for grub just the wiki page about grub.

I have no clue how they all became loop.

I used the wipefs command on sdc since that is the drive I want to install arch on but it’s still loop

#11 2018-09-19 18:37:35

Re: [solved] Grub cannot find EFI directory

The wipefs output is for diagnosis purposes, please post the output as requested.

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#12 2018-09-19 18:39:25

Re: [solved] Grub cannot find EFI directory

The wipefs output is for diagnosis purposes, please post the output as requested.

DEVICE OFFSET TYPE UUID LABEL
sdc 0x438 ext4 5e3ac50f-e4a9-42e9-a40e-acfb09b45858

#13 2018-09-19 18:51:24

Re: [solved] Grub cannot find EFI directory

Again, please edit your posts to use code tags.

So it looks like you’ve created the filesystem on the raw disk (/dev/sdc), rather than on a partition (e.g. /dev/sdc1). I’m not sure if it’s possible to remedy that without starting over, but I’m going to go ahead an recommend that you do that anyway. It seems you have a habit of skim reading, which may be how you found yourself in this situation. Read the wiki carefully, and take your time. Make sure you understand what you are doing before you do it.

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#14 2018-09-19 18:57:33

Re: [solved] Grub cannot find EFI directory

Again, please edit your posts to use code tags.

So it looks like you’ve created the filesystem on the raw disk (/dev/sdc), rather than on a partition (e.g. /dev/sdc1). I’m not sure if it’s possible to remedy that without starting over, but I’m going to go ahead an recommend that you do that anyway. It seems you have a habit of skim reading, which may be how you found yourself in this situation. Read the wiki carefully, and take your time. Make sure you understand what you are doing before you do it.

I’ve tried a lot of things after it didn’t work the first time. Also a reason why I might get I information wrong is due to a language barrier. Would you say I should start over the guide from the very beginning? I’ve done that several times already. I just seen to mess up the partitioning every time, also I am confused since it doesn’t work like it used to anymore.

Источник

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

Lw-Cui opened this issue

May 5, 2017

· 18 comments


Closed

grub-install: Error cannot find EFI directory

#5

Lw-Cui opened this issue

May 5, 2017

· 18 comments

Comments

@Lw-Cui

Hi Michiel,
I use Ubuntu 16.04 and when doing grub-install --boot-directory="$PWD/boot" /dev/loop0 I got error grub-install: cannot find EFI directory.
How should I fix it?
Thanks.

@Shuliyey

@MichielDerhaeg

Yeah, I kindof mentioned this in the docs. GRUB defaults to EFI on your system, so you have to specify that you want to use the old MBR BIOS bootloader with the --target=i386-pc. If you followed the docs, this is required. An EFI installation would require a GPT partition table and an EFI partition.

@Lw-Cui

Thanks.
But when using --target=i386-pc it said grub-install:Error /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
Does that mean I need install 32bit version?

@MichielDerhaeg

@ric96 mentioned that you might need to install grub-pc-bin first on Ubuntu if your system uses EFI, could you try that?

@Lw-Cui

Yes this issue has been moved forward:)
But now qemu show error: no such device: 1da96cd4-faaf-4a02-ac75-ec0bc60e4b65.
Maybe it’s wrong PARTUUID number?
Thanks for your patience!

@MichielDerhaeg

Did you add the --modules=part_msdos option to grub-install?

@Lw-Cui

Yes. I tried grub-install again to make sure it has this option.

@MichielDerhaeg

@Lw-Cui

Yes.
By the way I replaced it using root=/dev/sda1 and this error still occurred, while qemu with root=/dev/sda1 works fine all the time.

@MichielDerhaeg

The root option in grub.cfg isn’t used by GRUB to determine the root device, it’s for the kernel. The root devices is determined by GRUB when you do grub-install. Do you have the same issue when using the makefile to build the image?

@Shuliyey

what’s the output of

and this line in boot/grub/grub.cfg

linux /boot/bzImage quiet init=/bin/sh root=PARTUUID=........
boot

@Lw-Cui

@Shuliyey
fdisk -l image is

Disk image: 100 MiB, 104857600 bytes, 204800 sectors
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: 0x02170d17

设备       启动 Start 末尾 扇区 Size Id 类型
image1           2048 204799 202752  99M 83 Linux

and boot/grub/grub.cfg is


linux /boot/bzImage quiet init=/bin/sh root=PARTUUID=02170d17-01
boot

@Lw-Cui

@MichielDerhaeg
OK I will try Makefile tomorrow, currently I build them by hand.
You write awesome instruction:)

@Shuliyey

can you try upload your grub.cfg and /etc/fstab, i got a feeling it’s something to do one of these two @Lw-Cui

@MichielDerhaeg

@Lw-Cui
Thanks!
@Shuliyey
I disagree, I believe this is an error caused grub-install not installing the right modules so it can find the right filesystem. I think this error occurs before any file can even be read.

@MichielDerhaeg

I could confirm my suspicion if you would do grub-install with the --verbose option and pass me the output somehow.

@Shuliyey

@Lw-Cui

@MichielDerhaeg Yes Makefile works well! Thanks a lot:)
Then I could re-execute those commands by hand and find what’s going wrong.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Grub install error will not proceed with blocklists
  • Grub install error unknown filesystem
  • Grub install error unable to identify a filesystem
  • Grub install error more than one install device
  • Grub install error failed to get canonical path of cow

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии