[Bug 1990035] Re: update-grub outputs spurious error messages on systems with lvm
mike
1990035 at bugs.launchpad.net
Mon Sep 19 04:26:44 UTC 2022
** Also affects: grub2 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1990035
Title:
update-grub outputs spurious error messages on systems with lvm
Status in grub2 package in Ubuntu:
New
Status in os-prober package in Ubuntu:
Triaged
Bug description:
There are 4 instances of spurious error messages (that I have found) 2
in grub-common and 2 in os-prober in 22.04.1 (and I am sure many
older releases)
1) /usr/share/os-prober/common.sh
This will output an error if there is a non-active LVM partition.
In function fs_type (line 108) the call to lsblk (line 116) is not guarded by "2>/dev/null" and spuriously outputs
lsblk: /dev/mapper/VG-LV: not a block device
2) /usr/lib/os-probes/50mounted-tests
Outputs a error for any filesystem that grub can't read, but the native OS can.
At line 65 the call to grub-probe is not guarded by "2>/dev/null" and spuriously outputs
grub-probe: error: disk `lvmid/X7waXv-rMDA-5fQA-aw6l-ei1I-8Gz3-pQl3lr/DEqUcG-PfhJ-zOes-gvvA-jgdh-f8g5-8YktOE' not found.
for each active thin partition it finds. I did not test it with other file systems
3) /etc/grub.d/30_os-prober
outputs a spurious error if when looking for a UUID for a root partition that grub can't mount, but the native OS can (and hopefully the target OS can).
if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then (line 144)
the call to grub-probe needs to be guarded by "2>/dev/null"
4) /etc/grub.d/30_os-prober - /usr/share/grub/grub-mkconfig_lib
Function prepare_grub_to_access_device (line 121 of grub-mkconfig_lib) doesn't check if the device is mountable/readable by grub. It is called by /etc/grub.d/30_os-prober (line 268).
This only happens if a Linux system partition points to a boot partition that is not readable by GRUB and so is already invalid. One could argue all bets are off, but ....
Perhaps something like the following could be added
if [ x"`${grub_probe} --target=partmap --device "${LBOOT}" 2>/dev/null`" = x ] ; then
gettext_printf "boot partition "%s" is not readable by GRUB\n" "${LBOOT}" >&2
continue
fi
around line 258 in /etc/grub.d/30_os-prober and avoid the call to prepare_grub_to_access_device. This may give the user have half a chance of figuring out what they did wrong.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1990035/+subscriptions
More information about the foundations-bugs
mailing list