update-grub outputs spurious error messages on systems with lvm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
os-prober (Ubuntu) |
Triaged
|
Low
|
Unassigned |
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/
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/
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/
for each active thin partition it finds. I did not test it with other file systems
3) /etc/grub.
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="`
the call to grub-probe needs to be guarded by "2>/dev/null"
4) /etc/grub.
Function prepare_
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
continue
fi
around line 258 in /etc/grub.
Changed in os-prober (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |