LVM setup fails to install grub on virtio storage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debian-installer (Debian) |
New
|
Unknown
|
|||
debian-installer (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
grub2 (Ubuntu) |
Fix Released
|
Critical
|
Rafael David Tinoco | ||
lvm2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Any Eoan installation that depends on latest installer will face this issue when final user chooses LVM full disk partitioning type.
* Grub won't be able to install due to bad bootdevice variable in the installer. It will try to install grub to "/dev/mapper" and will fail. The default boot option will also be "/dev/mapper".
[Test Case]
* Download netboot files from current installer (vmlinuz and initrd files).
* Create a KVM guest running from these files, with a NIC connected to the internet.
* Initiate a network installation inside the KVM guest, choosing the Entire Disk - LVM partitioning option.
* Wait installation to finish and to start the grub-install phase. It will ask where to install grub, having, as default, "/dev/mapper". By default, it might simply try to grub-install /dev/mapper, which will also fail.
* That happens because /dev/disk/by-id/ has an unexpected (by the installer) symlink added by lvm2 package that grub-installer (used by debian-installer) does not expect (when using grub-mkdevice command).
[Simplified Test Case]
* To add a PV + VG + LVM in a KVM guest to an empty virtio disk, for example, and to check if the command:
grub-mkdevicemap --no-floppy -m -
lists /dev/vdX1 in front of /dev/vdX. This will be a sign that:
/dev/disk/
[Regression Potential]
There are 3 alternatives to fix this and I have chosen the one I believe has the smaller potential for any type of regression. Comment #30 describes what caused the regression and these 3 alternatives:
(1) To revert this change for current release, since this rule was added to "make navigation a bit easier using PV UUIDs", as the commit says. We would worry about installer changes in the next release.
(2) Another possibility would be to change the logic inside "grub-mkdevicem
(3) Another option would be to change grub-installer package/logic. Unfortunately, a few days before the full freeze, I don't think messing with the installer would be a good option to avoid regressions (potential regression item would grow in significance).
=> I'm choosing (2) because ubuntu foundations already faced a similar situation, when grub-mkdevicemap.c file was removed from grub2 code and they re-added it by using a quilt patch, assuming it was the easiest and better to maintain. I'm doing something similar, patching the patch that creates grub-mkdevicemap.c file again to ignore /dev/disk/
[Other Info]
Comment #26 has the TL;DR version of the problem.
https:/
[Original Description]
The Eoan debian-installer ISO fails to install GRUB on LVM installs with virtio storage, as it runs grub-install with /dev/mapper as a target (a directory), even if instructed to target a device.
The following steps to reproduce have been prepared running the 20190730 build, but this has been broken since about June 18, 2019. Steps to reproduce:
$ md5sum eoan-server-
f591e30485e5f0b
$ qemu-img create -f raw disk1.img 8G
Formatting 'disk1.img', fmt=raw size=8589934592
$ kvm -m 1024 -boot d -cdrom eoan-server-
Proceed with all the defaults. In the "Partition disk" step select "Guided - use entire disk and set up LVM". Go ahead accepting the defaults. At the "Install the GRUB boot loader" step select "/dev/vda" as the target device. The installer will actually run `grub-install --force /dev/mapper` and fail after a while. The wrong command is visible both in the d-i screen and by running `ps` on a different console.
Full installer syslog: http://
It's interesting how this doesn't happen when not using virtio. If from the commands above the "if=virtio" option is dropped then everything works as expected. In this case the target block device is called /dev/sda instead of /dev/vda.
Related branches
- Dimitri John Ledkov (community): Approve (coredev)
- Canonical Server: Pending requested
-
Diff: 93 lines (+71/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch (+62/-0)
tags: | added: rls-ee-incoming |
Changed in grub-installer (Ubuntu): | |
importance: | Undecided → Critical |
Changed in debian-installer (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in debian-installer (Debian): | |
status: | Unknown → New |
tags: | added: id-5d8cf66b49519e737f6e6856 |
no longer affects: | grub-installer (Ubuntu Eoan) |
no longer affects: | debian-installer (Ubuntu Eoan) |
Changed in grub-installer (Ubuntu): | |
status: | Triaged → In Progress |
Changed in lvm2 (Ubuntu): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu): | |
status: | New → In Progress |
Changed in lvm2 (Ubuntu): | |
importance: | Undecided → Critical |
Changed in debian-installer (Ubuntu): | |
importance: | Undecided → Critical |
assignee: | nobody → Rafael David Tinoco (rafaeldtinoco) |
Changed in grub-installer (Ubuntu): | |
assignee: | nobody → Rafael David Tinoco (rafaeldtinoco) |
Changed in lvm2 (Ubuntu): | |
assignee: | nobody → Rafael David Tinoco (rafaeldtinoco) |
no longer affects: | grub-installer (Ubuntu) |
Changed in grub2 (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Critical |
assignee: | nobody → Rafael David Tinoco (rafaeldtinoco) |
Changed in grub2 (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in debian-installer (Ubuntu): | |
status: | In Progress → Invalid |
Changed in lvm2 (Ubuntu): | |
status: | In Progress → Invalid |
Changed in debian-installer (Ubuntu): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
Changed in lvm2 (Ubuntu): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
Changed in debian-installer (Ubuntu): | |
importance: | Critical → Undecided |
Changed in lvm2 (Ubuntu): | |
importance: | Critical → Undecided |
1) doing LVM all in one install manually, with BIOS boot, pops up the question of where to install the bootloader to.... when it shouldn't ask it
2) when selecting it tries to do 'grub-install /dev/mapper' which is bogus
3) manually running 'grub-install /dev/vda' works and forcing the install to continue without installer works and reboots fine
4) maybe this is related to change of default lvm name (now vgubuntu) or change in lvm
5) i think lvm and udev now want bind-mounted /dev and /run, not sure if that is happening or not
This needs escalation.