grub-multi-install attempts to mount a non-existing device after migrating to another system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I recently moved my Ubuntu installation from Parallels to Virtualbox, which naturally resulted in updated disks' UUIDs. Normally that should be a problem as Ubuntu should autodetect such change and act accordingly.
However, upon upgrading grub-efi-
Setting up grub-efi-
mount: /var/lib/grub/esp: special device /dev/disk/
es not exist.
The Parallel's disk ID that it attempts to mount indeed no longer exists. The EFI partition is correctly mounted at /boot/efi, since the /etc/fstab uses partition' UUID to address it and that didn't change during the migration, so there's no reason why the script should be failing.
The debconf shows the following:
dawidw@ubuntu:~$ sudo debconf-
grub-efi-amd64 grub2/kfreebsd_
grub-efi-amd64 grub-efi/
grub-efi-amd64 grub2/force_
grub-efi-amd64 grub2/linux_
grub-efi-amd64 grub2/update_nvram boolean true
grub-efi-amd64 grub2/linux_cmdline string
grub-efi-amd64 grub2/unsigned_
grub-efi-amd64 grub2/no_
grub-efi-amd64 grub2/device_
grub-efi-amd64 grub-efi/
grub-efi-amd64 grub-efi/
grub-efi-amd64 grub-efi/
grub-efi-amd64 grub2/kfreebsd_
Note that it recored the new, correct "/dev/disk/
I debugged it further and can see that the failure happens in /usr/lib/
1) in "# We either migrate /boot/efi over, or we check if we have invalid devices" section, it correctly detects that the Parallels device does not exist ("if [ ! -e "${device%,}" ]", setting the valid=0
2) given that valid=0, my understanding is that at this point the "install_
3) the "$RET" variable still contains both of the disks from grub-efi/
4) in "# Run the installer" section, the script iterates over each of the disks, attempting to mount ("mount $real_device $mntpoint) the non-existing one, which results in the aforementioned script failure.
My understanding here is that there are two problems:
1) "install_
2) there's no check for whether the device exists at all before the script proceeds with mounting and grub-installation attempt
description: | updated |
affects: | grub2-signed (Ubuntu) → grub2 (Ubuntu) |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | added: rls-hh-incoming |
tags: | added: fr-877 |
tags: | removed: rls-hh-incoming |
Note that I worked around by purging all grub-* packages and reinstalling grub-efi again.