grub-install: error: failed to register the EFI boot entry: Operation not permitted.

Bug #1901650 reported by Haw Loeung
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi,

Seeing a bunch of these across various units, all of which were recently provisioned in Azure:

| ubuntu@machine-1:~$ sudo apt-get dist-upgrade
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| Calculating upgrade... Done
| 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
| 1 not fully installed or removed.
| After this operation, 0 B of additional disk space will be used.
| Do you want to continue? [Y/n] y
| Setting up grub-efi-amd64-signed (1.142.8+2.04-1ubuntu26.6) ...
| Installing grub to /boot/efi.
| Installing for x86_64-efi platform.
| grub-install: warning: Internal error.
| grub-install: error: failed to register the EFI boot entry: Operation not permitted.

It keeps trying to install on either /dev/sda15 or /dev/sdb15 (some units have attached volumes).

| ubuntu@machine-1:~$ sudo parted -l
| Model: Msft Virtual Disk (scsi)
| Disk /dev/sda: 34.4GB
| Sector size (logical/physical): 512B/512B
| Partition Table: gpt
| Disk Flags:
|
| Number Start End Size File system Name Flags
| 14 1049kB 5243kB 4194kB bios_grub
| 15 5243kB 116MB 111MB fat32 boot, esp
| 1 116MB 34.4GB 34.2GB ext4

Focal.

| Start-Date: 2020-10-26 16:02:51
| Upgrade: perl-base:amd64 (5.30.0-9build1, 5.30.0-9ubuntu0.2), bind9-dnsutils:amd64 (1:9.16.1-0ubuntu2.3, 1:9.16.1-0ubuntu2.4), grub-common:amd64 (2.04-1ubuntu26.4, 2.04-1ubuntu26.6), snapd:amd64 (2.46.1+20.04, 2.47.1+20.04), bind9-host:amd64 (1:9.16.1-0ubuntu2.3, 1:9.16.1-0ubuntu2.4), perl-modules-5.30:amd64 (5.30.0-9build1, 5.30.0-9ubuntu0.2), grub2-common:amd64 (2.04-1ubuntu26.4, 2.04-1ubuntu26.6), plymouth-theme-ubuntu-text:amd64 (0.9.4git20200323-0ubuntu6, 0.9.4git20200323-0ubuntu6.1), grub-pc:amd64 (2.04-1ubuntu26.4, 2.04-1ubuntu26.6), libplymouth5:amd64 (0.9.4git20200323-0ubuntu6, 0.9.4git20200323-0ubuntu6.1), libperl5.30:amd64 (5.30.0-9build1, 5.30.0-9ubuntu0.2), grub-pc-bin:amd64 (2.04-1ubuntu26.4, 2.04-1ubuntu26.6), grub-efi-amd64-bin:amd64 (2.04-1ubuntu26.4, 2.04-1ubuntu26.6), plymouth:amd64 (0.9.4git20200323-0ubuntu6, 0.9.4git20200323-0ubuntu6.1), grub-efi-amd64-signed:amd64 (1.142.6+2.04-1ubuntu26.4, 1.142.8+2.04-1ubuntu26.6), perl:amd64 (5.30.0-9build1, 5.30.0-9ubuntu0.2), accountsservice:amd64 (0.6.55-0ubuntu12~20.04.1, 0.6.55-0ubuntu12~20.04.2), bind9-libs:amd64 (1:9.16.1-0ubuntu2.3, 1:9.16.1-0ubuntu2.4), libaccountsservice0:amd64 (0.6.55-0ubuntu12~20.04.1, 0.6.55-0ubuntu12~20.04.2)
| Error: Sub-process /usr/bin/dpkg returned an error code (1)
| End-Date: 2020-10-26 16:03:54

With apt term.log - https://paste.ubuntu.com/p/5HnGZ43QzH/

Haw Loeung (hloeung)
description: updated
Revision history for this message
Haw Loeung (hloeung) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

We think this is not a bug in grub. It might be a bug in the kernel, but it's also likely to be a bug in the firmware implementation. Probably in the reference EDK2, given that it happens across various machines, whether real or virtual.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu Focal):
status: New → Confirmed
Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert Sander (gurubert) wrote :

May a dup of bug #1872212 ?

The solution there is to add --no-nvram to grub-install.

Revision history for this message
Haw Loeung (hloeung) wrote :

Adding '--no-nvram' as advised by Robert in #5 seems to work.

Without:

| ubuntu@machine-0:~$ sudo /usr/lib/grub/grub-multi-install --target=x86_64-efi
| Installing grub to /boot/efi.
| Installing for x86_64-efi platform.
| grub-install: warning: Internal error.
| grub-install: error: failed to register the EFI boot entry: Operation not permitted.
| Installing grub to /boot/efi.
| Installing for x86_64-efi platform.
| ^C
| ubuntu@machine-0:~$

With:

| ubuntu@machine-0:~$ sudo /usr/lib/grub/grub-multi-install --target=x86_64-efi --no-nvram
| Installing grub to /boot/efi.
| Installing for x86_64-efi platform.
| Installation finished. No error reported.
| ubuntu@machine-0:~$

no longer affects: grub2 (Ubuntu Focal)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.