grub-install removes other EFI boot entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Suppose you have some kind of RAID array. You expect disks to burst into flame, and the machine continue to work.
Without some special effort, grub will insist that exactly one EFI entry is active for Ubuntu, which is not what we should want. If the disk fails that has the only boot entry on it, then you don't boot again!
EFI has a boor order built-in. There's no reason to insist on having exactly one.
Here's a healthy EFI configuration with two disks, each of which can be used for booting to Ubuntu. Then, we install grub to a third disk. "grub-install" removes the other two boot entries!
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii efibootmgr 0.12-4 amd64 Interact with the EFI Boot Manager
ii grub-common 2.02~beta2-
ii grub-efi-amd64 2.02~beta2-
$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0001,0000
Boot0000* ubuntu HD(2,GPT,
Boot0001* ubuntu HD(2,GPT,
$ ls -l /dev/disk/
lrwxrwxrwx 1 root root 10 Apr 8 10:45 /dev/disk/
lrwxrwxrwx 1 root root 10 Apr 8 10:45 /dev/disk/
#### Here comes the deletion lines! "-B" is delete!
$ sudo umount /boot/efi && sudo mount /dev/sdc2 /boot/efi && sudo grub-install /dev/sdc2 -v
...
grub-install: info: copying `/boot/
grub-install: info: Registering with EFI: distributor = `ubuntu', path = `\EFI\ubuntu\
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
grub-install: info: executing efibootmgr -b 0000 -B.
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0001
Boot0001* ubuntu
grub-install: info: executing efibootmgr -b 0001 -B.
BootCurrent: 0000
Timeout: 5 seconds
No BootOrder is set; firmware will attempt recovery
grub-install: info: executing efibootmgr -c -d /dev/sdc -p 2 -w -L ubuntu -l \EFI\ubuntu\
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000
Boot0000* ubuntu
Installation finished. No error reported.
$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000
Boot0000* ubuntu HD(2,GPT,
$ ls -l /dev/disk/
lrwxrwxrwx 1 root root 10 Apr 8 10:45 /dev/disk/
If you're installing something that has the same name, like "ubuntu", expect all your prized redundancy to be squashed flat.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: grub-common 2.02~beta2-
ProcVersionSign
Uname: Linux 4.4.0-16-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
CurrentDesktop: GNOME
Date: Fri Apr 8 12:56:54 2016
InstallationDate: Installed on 2014-05-07 (701 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)
There is a "--bootloader-id=" argument to grub-install that lets you choose a different name and only remove other entries with that new name. So, if you're careful, you can choose unique names for each and get other entries.
It's wrong and weird to remove anything by running "install" though. It might even be okay to make the most recently "grub-install"ed device the first, preferred device in the boot order, but it's not okay to remove others.