LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-27-2017, 10:44 AM   #1
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Rep: Reputation: 30
Grub-install says "error cannot find EFI directory"


I was using a working Debian 8 installation but decided to reformat and install Debian 9.

However, after completing the installation, it wouldn't configure Grub(2).

The Partition table is as follows:
Code:
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048   1050623   1048576   512M 83 Linux #ext2 mounted on /boot
/dev/sda2         1050624  55166975  54116352  25.8G  7 HPFS/NTFS/exFAT #Windows partition - empty
/dev/sda3        55169022 976766975 921597954 439.5G  5 Extended
/dev/sda5        55169024 317313023 262144000   125G 83 Linux #installation mounted on /
/dev/sda6       317315072 954238975 636923904 303.7G 83 Linux #home partition mounted on /home
/dev/sda7       954241024 976766975  22525952  10.8G 82 Linux swap / Solaris
On reboot, grub does not appear.

Booting from the installation USB I can drop down to the Grub> command line and can boot up to a working system by entering the grub commands as follows:
Code:
grub> set root=(hd1,5)
grub> linux (hd1,1)/boot/vmlinuz-4.9.0-3-amd64 root=/dev/sda5
grub> initrd (hd1,1)/boot/initrd.img-4.9.0-3-amd64
grub> boot
However, I cannot install the bootloader.

Code:
dave@Lechuck:~$ sudo grub-install
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
dave@Lechuck:~$
My /boot directory contains no efi directory:
Code:
dave@Lechuck:~$ ls /boot/
config-4.9.0-3-amd64  grub  initrd.img-4.9.0-3-amd64  lost+found  System.map-4.9.0-3-amd64  vmlinuz-4.9.0-3-amd64
dave@Lechuck:~$
How can I remedy this?

Last edited by cov; 06-27-2017 at 10:45 AM.
 
Old 06-27-2017, 11:55 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Are you booting your system as Legacy BIOS or EFI? If the latter, try the former.
 
Old 06-27-2017, 12:58 PM   #3
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Thanks for the help.

The machine is a Lenovo Ideapad Z570 and apparently it runs EFI:
Code:
dave@Lechuck:~$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD" 
EFI boot on HDD
dave@Lechuck:~$
However, it doesn't seem possible to change this in the BIOS.
 
Old 06-27-2017, 01:05 PM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
First of all, turn off Secure Boot on the security tab. Then see if the Legacy BIOS option appears under Boot mode on the Boot tab (or something like that, I don't have a Lenovo).
 
Old 06-27-2017, 01:21 PM   #5
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Thanks, I'll look at that.

I've seen this:https://help.ubuntu.com/community/UEFI

I wish I'd seen it before installing.
 
Old 06-29-2017, 03:07 AM   #6
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
What. A. Mission.

I thought I'd found the solution when I saw the boot-repair bootdisk, but that just trashed my root partition (fortunately the /home partition was untouched). No problem, though: rather than trying to restore my partition table, I booted up from my Debian installation USB and started again.

However, every time it failed right at the end of the installation when it couldn't install Grub.

I had prepared my sda1 partition as 500MB initially formatted as ext2, but it didn't like that. I changed it to EFI, but that still didn't work. I tried FAT32 without success. Even simply deleting the partition didn't work.

Eventually, I started from scratch without the partition, just 500MB freespace. This I specified as EFI and it finally worked.

Incidently, Hydrurga, there was no option in the SECURITY tab for changing to legacy BIOS, just an option for changing the BIOS password, from memory.

Thanks for trying, though.
 
  


Reply

Tags
boot grub efi



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Attempting to update grub results in error "no such file or directory" Blixtrande Linux - Newbie 1 02-02-2017 11:23 PM
[SOLVED] A "DropBox" question, error: Can't sync:".directory":access denied. Robert.Thompson Slackware 4 08-25-2011 09:02 AM
VLC + sudo = "cannot find any file in directory" error skubik Linux - General 3 11-30-2009 01:52 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
error while trying to install program: "X11/Xlib.h: No such file or directory" nate1 Linux - Newbie 3 05-21-2004 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration