grub-install -> efibootmgr: option requires an argument -- 'd'

Bug #1720572 reported by AnrDaemon
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

While upgrading my 14.04 system today, I saw the following footcloth in the apt logs:

Setting up shim-signed (1.32~14.04.2+0.9+1474479173.6c180c6-1ubuntu1) ...
Installing for x86_64-efi platform.
efibootmgr: option requires an argument -- 'd'
efibootmgr version 0.5.4
usage: efibootmgr [options]
        -a | --active sets bootnum active
        -A | --inactive sets bootnum inactive
        -b | --bootnum XXXX modify BootXXXX (hex)
        -B | --delete-bootnum delete bootnum (hex)
        -c | --create create new variable bootnum and add to bootorder
        -d | --disk disk (defaults to /dev/sda) containing loader
        -e | --edd [1|3|-1] force EDD 1.0 or 3.0 creation variables, or guess
        -E | --device num EDD 1.0 device number (defaults to 0x80)
        -g | --gpt force disk with invalid PMBR to be treated as GPT
        -H | --acpi_hid XXXX set the ACPI HID (used with -i)
        -i | --iface name create a netboot entry for the named interface
        -l | --loader name (defaults to \elilo.efi)
        -L | --label label Boot manager display label (defaults to "Linux")
        -n | --bootnext XXXX set BootNext to XXXX (hex)
        -N | --delete-bootnext delete BootNext
        -o | --bootorder XXXX,YYYY,ZZZZ,... explicitly set BootOrder (hex)
        -O | --delete-bootorder delete BootOrder
        -p | --part part (defaults to 1) containing loader
        -q | --quiet be quiet
           | --test filename don't write to NVRAM, write to filename.
        -t | --timeout seconds set boot manager timeout waiting for user input.
        -T | --delete-timeout delete Timeout.
        -u | --unicode | --UCS-2 pass extra args as UCS-2 (default is ASCII)
        -U | --acpi_uid XXXX set the ACPI UID (used with -i)
        -v | --verbose print additional information
        -V | --version return version and exit
        -w | --write-signature write unique sig to MBR if needed
        -@ | --append-binary-args file append extra args from file (use "-" for stdin)
Installation finished. No error reported.
No DKMS packages installed: not changing Secure Boot validation state.

This same footcloth is printed when I'm attempting manual
# grub-install --recheck --no-floppy /dev/md1

/dev/md1 is a mdadm RAID1 device.

# lsblk -nbo NAME,SIZE,FSTYPE,UUID,MOUNTPOINT
sda 500107862016
├─sda1 272629760 linux_raid_member 8738f3e7-9189-6e1d-e368-bf24bd0fce41
│ └─md0 272564224 vfat BC88-CB0B /boot/efi
├─sda2 21088960512 linux_raid_member d36f3bf5-f320-055f-317d-388008f835aa
│ └─md1 21072052224 ext4 863afe5d-f8fe-4078-a194-5018e4a0f428 /
├─sda3 2147483648 swap 74889c32-6f20-4df0-8286-783679662202 [SWAP]
└─sda4 476456157184 linux_raid_member 5aef7b1d-9c6d-c2a4-35da-8c23a0a15a85
  └─md2 476456091648 ext3 01a84aa3-b283-4691-a5ad-ac8ec8ae7641 /home
sdb 500107862016
├─sdb1 272629760 linux_raid_member 8738f3e7-9189-6e1d-e368-bf24bd0fce41
│ └─md0 272564224 vfat BC88-CB0B /boot/efi
├─sdb2 21088960512 linux_raid_member d36f3bf5-f320-055f-317d-388008f835aa
│ └─md1 21072052224 ext4 863afe5d-f8fe-4078-a194-5018e4a0f428 /
├─sdb3 2147483648 swap 0fb5dea5-43c3-4489-bdae-063daf4e9965 [SWAP]
└─sdb4 476456157184 linux_raid_member 5aef7b1d-9c6d-c2a4-35da-8c23a0a15a85
  └─md2 476456091648 ext3 01a84aa3-b283-4691-a5ad-ac8ec8ae7641 /home

Revision history for this message
Steve Langasek (vorlon) wrote :

What version of grub2-common do you have installed? Does 'which grub-install' point to a file provided by the grub2-common package?

From what I can see, all versions of grub-install in Ubuntu, back to 14.04 and earlier, correctly pass an argument to -d.

Changed in shim-signed (Ubuntu):
status: New → Incomplete
Revision history for this message
AnrDaemon (anrdaemon) wrote : Re: [Bug 1720572] Re: grub-install -> efibootmgr: option requires an argument -- 'd'

# dpkg --list 'grub2-*'| cat -
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============-======================-============-=====================================================
ii grub2-common 2.02~beta2-9ubuntu1.14 amd64 GRand Unified Bootloader (common files for version 2)

# which grub-install
/usr/sbin/grub-install

# file /usr/sbin/grub-install
/usr/sbin/grub-install: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=5698483f81b8e9efb69b601edfa2111c1dd772fb, stripped

Revision history for this message
Steve Langasek (vorlon) wrote :

Ok, that looks like the right grub-install. Can you confirm with 'debsums -s grub2-common' that the file hasn't been overwritten from a different source?

Also, can you try running 'strace -ff -eexecve -s 256 grub-install --recheck --no-floppy /dev/md1' to see exactly how grub-install is invoking efibootmgr?

Revision history for this message
AnrDaemon (anrdaemon) wrote :

# debsums -s grub2-common && echo Ok
Ok

Revision history for this message
Steve Langasek (vorlon) wrote :

strace shows:

[pid 30986] execve("/bin/efibootmgr", ["efibootmgr", "-q", "-c", "-d"], [/* 35 vars */]) = 0

this points to a problem in grub-core/osdep/unix/platform.c:grub_install_register_efi(), where efidir_disk is being set to NULL.

This suggests that grub is unable to resolve your /dev/md1 to a physical disk.

affects: shim-signed (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
status: Incomplete → New
Revision history for this message
AnrDaemon (anrdaemon) wrote :

In that case, this may be helpful:

# mdadm --detail --scan
ARRAY /dev/md0 metadata=0.90 UUID=8738f3e7:91896e1d:e368bf24:bd0fce41
ARRAY /dev/md1 metadata=1.2 name=ubuntu:1 UUID=d36f3bf5:f320055f:317d3880:08f835aa
ARRAY /dev/md2 metadata=0.90 UUID=5aef7b1d:9c6dc2a4:35da8c23:a0a15a85

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

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

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Wladimir Mutel (mwg) wrote :

I have mirrored EFI pertition with mdadm metadata 0.90 and I also have this problem.
Is it going to be fixed earlier than Ubuntu 20.04 ?

Revision history for this message
Wladimir Mutel (mwg) wrote :

Btw, this is a duplicate of https://bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/1466150 , reported 3+ years ago

Revision history for this message
Wladimir Mutel (mwg) wrote :

There is a patch at https://savannah.gnu.org/bugs/?46805 , why not try it ?

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.