EFI booting + /boot on LVM == inaccessible boot menu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
This issue makes it impossible for UEFI users to access to boot menu and choose their kernel if /boot is installed on LVM.
[Test case]
1) Install Ubuntu on UEFI; put /boot on a LVM LV.
2) Reboot after the install
3) Verify that you will get a GRUB menu at boot.
[Regression potential]
Give particular attention to boot behavior on different disk setups: failure to show the menu on LVM or other disk setups when holding the SHIFT key, or showing the menu at every boot unnecessarily on other types of disk configurations: /boot on a physical partition, etc.
---
Because EFI does not support instantaneous read of modifier keys (i.e. holding down shift at boot), the only way to reliably show a boot menu is by letting the system boot, interrupting the boot, and letting the menu be displayed because 'recordfail' has been set.
If /boot/grub is on LVM, recordfail does not work, because grub doesn't have write support on LVM, so saveenv doesn't work. Indeed, from the grub.cfg on such a system, the recordfail function is written as:
function recordfail {
set recordfail=1
# GRUB lacks write support for lvm, so recordfail support is disabled.
}
The interaction of these two limitations means that systems with /boot/grub on LVM cannot reliably get a grub menu, ever.
While I think that in the long term we should always put /boot/grub on the ESP (which means it will always be writable by grub), which is in fact what we did for Ubuntu Core, in the meantime I believe what we need to do here is always show the boot menu if we are booted under EFI and we have a non-writable grubenv.
tags: | added: id-5bd8c48c3e55f90e687269fe |
Changed in grub2 (Ubuntu): | |
status: | New → Fix Committed |
description: | updated |
JFTR so I don't forget to mention it: I don't think putting /boot/grub on the ESP is a good idea, as it makes things so much harder if you want to install multiple distributions on one system; unless you put it in a vendor, or better, machine-id, specific subdirectory.