Bug 1201220 - grub2-install fails if is missing /usr/lib/grub/x86_64-efi, or why grub2-efi should require grub2-efi-modules
Summary: grub2-install fails if is missing /usr/lib/grub/x86_64-efi, or why grub2-efi ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-12 11:07 UTC by Martijn Ras
Modified: 2020-06-21 20:21 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-11-30 18:32:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martijn Ras 2015-03-12 11:07:01 UTC
Description of problem:
With grub2-efi and shim installed, but without grub2-efi-modules, grub2-install fails if is missing /usr/lib/grub/x86_64-efi.

Version-Release number of selected component (if applicable):
grub2-efi-2.02-0.13.fc21.x86_64
shim-0.8-4.x86_64

How reproducible:
Always

Steps to Reproduce:
1. grub2-install /dev/sda

Actual results:
fails on missing /usr/lib/grub/x86_64-efi

Expected results:
grub install working

Additional info:
It took me a long while to figure out that grub2-efi-modules contains the missing bits and pieces.

I've already updated https://fedoraproject.org/wiki/GRUB_2, to hopefully keep others from wasting a couple of hours.

I think the grub2-efi package should require grub2-efi-modules.

Comment 1 joshua 2015-05-31 23:09:48 UTC
I have similar results here as well.

When on a machine that was installed via an EFI booted USB key, and normally boots via EFI, the following should work:

# grub2-mkconfig > /boot/grub2/grub.cfg
# grub2-install

... yet it doesn't by default

On an grub2 install to EFI, you don't even need to specify the drive on which to install, as EFI isn't technically a drive:

# grub2-install 
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.


Install the grub2-efi-modules package, and grub2-install work perfectly:

#grub2-install 
Installing for x86_64-efi platform.
Installation finished. No error reported.

Comment 2 Fedora End Of Life 2015-11-04 11:38:57 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 joshua 2015-11-04 15:13:23 UTC
Same issue in Fedora 23.  Please address this... grub2-install is literally broken after install on systems that use the EFI boot standard.

Comment 4 Fedora End Of Life 2016-11-24 11:33:29 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 joshua 2016-11-26 00:46:04 UTC
Same issue on a new install of Fedora 25:

[user@localhost ~]$ cat /etc/fedora-release 
Fedora release 25 (Twenty Five)

[user @localhost ~]$ sudo grub2-install 
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.

[user@localhost ~]$ rpm -qa | grep efi
efibootmgr-14-3.fc25.x86_64
grub2-efi-2.02-0.34.fc24.x86_64
efivar-libs-30-4.fc25.x86_64

Comment 6 Fedora End Of Life 2017-11-16 19:03:19 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 7 joshua 2017-11-27 20:15:45 UTC
Same issue on Fedora 27 x86_64:

$ rpm -qa | grep grub
grub2-tools-extra-2.02-19.fc27.x86_64
grub2-tools-efi-2.02-19.fc27.x86_64
grub2-efi-x64-2.02-19.fc27.x86_64
grubby-8.40-7.fc27.x86_64
grub2-common-2.02-19.fc27.noarch
grub2-tools-minimal-2.02-19.fc27.x86_64
grub2-tools-2.02-19.fc27.x86_64


$ sudo grub2-install 
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.


$ sudo dnf provides /usr/lib/grub/x86_64-efi
Last metadata expiration check: 0:31:56 ago on Mon 27 Nov 2017 02:38:25 PM EST.
grub2-efi-x64-modules-1:2.02-19.fc27.noarch : Modules used to build custom
                                            : grub.efi images
Repo        : updates
Matched from:
Filename    : /usr/lib/grub/x86_64-efi


$ sudo dnf install -y grub2-efi-x64-module
(completes successfully)


#Then....
$ sudo grub2-install 
Installing for x86_64-efi platform.
Installation finished. No error reported.


So why is grub2-install broken and unable to work without grub2-efi-x64-module... for multiple years now?
Shouldn't the grub2-tools package just Depend on grub2-efi-x64-module package?

Comment 8 RobbieTheK 2017-11-30 19:05:37 UTC
> So why is grub2-install broken and unable to work without
> grub2-efi-x64-module... for multiple years now?
> Shouldn't the grub2-tools package just Depend on grub2-efi-x64-module
> package?

I was able to install it manually this way:
  dnf install https://www.rpmfind.net/linux/fedora/linux/releases/27/Everything/x86_64/os/Packages/g/grub2-efi-x64-modules-2.02-18.fc27.noarch.rpm

Still didn't help. grub is just not picking up the new kernel. I posted at https://ask.fedoraproject.org/en/question/114407/grub2-w-uefi-does-not-pick-up-new-kernels-even-after-upgrade-to-fedora-27/ and there's a thread at https://superuser.com/questions/1075173/grub-does-not-pick-up-new-kernels-was-how-to-update-fedoras-kernel

Comment 9 Ben Cotton 2018-11-27 17:58:41 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ben Cotton 2018-11-30 18:32:23 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 11 Oli Wade 2020-02-18 15:45:58 UTC
This seems broken still on CentOS8; there is no dependency explicit.

Comment 12 antofthy 2020-03-17 06:52:03 UTC
Still an issue with a Fedora 31 installed from live USB, on EFI machine

Comment 13 joshua 2020-03-17 11:43:45 UTC
I'm still seeing this on Fedora 30 and 31 as well.

Comment 14 joshua 2020-03-17 11:46:09 UTC
Can someone re-open this bug and change the version to Fedora 31?

Comment 15 manu 2020-04-22 05:55:45 UTC
My pc has dual boot windows 10 and centos 7 Installed in UEFI mode and GPT partition table.
I had the same problem in my centos 7 after I accidentally changed the boot option from UEFI to legacy. After changing back to UEFI I found the grub was corrupted. The fix which worked is as follows.
# IMPORTANT- the following steps should be done in resue mode and not in live boot. you need to internet access in rescue mode and hence ethernet connection is required.( use the link given in step 1).
1. Boot into rescue mode  select continue, and connect to internet using ethernet cable. Use this link.  https://sites.google.com/site/syscookbook/rhel/rhel-rescue-mode-ssh
enter command:
chroot /mnt/sysimage
sudo yum install grub2-efi-modules
enter the install command again to verify if installation is completed.
2. Identify your machine hard disk and you efi system partition(ESP) (use command lsblk). In my case these are sda and ESP sda1.
3. Enter the following command: sudo mount /dev/sda1 /boot/efi
(replace sda1 with your corresponding ESP.)
4. Install grub2 using the command:
/sbin/grub2-install /dev/sda
5. Update grub using:
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
 
you can check if grub is updated by listing all the menu entries that will be displayed at system boot, issue the following command:

[root@host ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

exit rescue mode and reboot your PC.

Comment 16 Rahul 2020-06-21 20:21:28 UTC
The above steps given by Manu on 2020-04-22 05:55:45 UTC did not work for me, I am afraid. 
I am trying to setup my new laptop (Acer Aspire 5) to dual-boot Win10 and CentOS 8. While Win10 was pre-installed, after completing the installation of CentOS 8, I do not remember an option for the location of the boot loader to be defined (might have missed I believe).

Now, after completing the CentOS installation, I need to use the F12 key to allow BIOS to present me the boot menu choices (DVD, Windows, Linux, with a couple more), else it boots into Windows directly.
  
While the (pressing F12) option works okay as a workaround, what I wish to do is set up the GRUB as my boot loader and followed the steps outlined above, specifically, 
Steps 1 (used the CentOS DVD to boot into the rescue mode and got the networking simply by using 'ifup enp2s0'), 
Step  2 & 3 (already mounted at sda6)
Step  4 - still gives the error "/sbin/grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn' exist. Please specify --target or --directory"

Hope this can be looked into !


Note You need to log in before you can comment on or make changes to this bug.