[Bug 1987679] Re: os-prober leaves filesystems (lvm-thin, lvm snap) mounted
mike
1987679 at bugs.launchpad.net
Fri Aug 26 15:37:11 UTC 2022
well Julian is right and I am wrong. I apologize I should have picked up
on it quicker (I'm sick, too many drugs and not the good kind)
The culprit is linux-boot-prober which executes /usr/lib/linux-boot-
probe/50mounted-tests which
set -e
...
if type grub-mount >/dev/null 2>&1 && \
type grub-probe >/dev/null 2>&1 && \
grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
mounted=1
type="$(grub-probe -d "$partition" -t fs)"
grub-probe fails causing 50mounted-tests to quit with the partition
mounted.
simply changing to
type="$(grub-probe -d "$partition" -t fs || true)"
solves the mount problem, correctly(?) ignores a thin-partition, but
adds bad entries for the thick snapshot (if it was accidental - it will
boot into the base of the snapshot, not sure all that will happen if
fstab and grub.cfg were edited)
changing it to
type="$(grub-probe -d "$partition" -t fs || echo bad)"
and adding a case entry for bad to unmount and then quit would at least create a correct grub.cfg.
IMHO what should happen is any failed grub fs should try to mount fs ,
search for a separate boot partition and see if it is bootable.
As a separate comment - not sure where to make it, but I think the whole plan for "other linux's" is flawed, as it stands if I boot into an old system, I have to update-grub before rebooting, otherwise I won't be able to boot the newer systems (or at least not their curren.
I would seem that one entry per other system, merely loading its grub.cfg would make things simpler, cleaner and always "up-to-date" - FWIW
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to os-prober in Ubuntu.
https://bugs.launchpad.net/bugs/1987679
Title:
os-prober leaves filesystems (lvm-thin, lvm snap) mounted
Status in os-prober package in Ubuntu:
New
Bug description:
If one happens to have by accident (or on purpose) a thick LVM snapshot, or a thin-LV with a copy of a system on it, update-grub reports
/sbin/grub-probe: error: unknown filesystem.
Found Ubuntu 22.04.1 LTS on /dev/mapper/vgxubuntu-s22.04
and
/sbin/grub-probe: error: disk `lvmid/X7waXv-rMDA-5fQA-aw6l-ei1I-8Gz3-pQl3lr/k3Ze1u-Mfwc-pxUt-7fXa-FjSZ-7IkX-HAxf3b' not found.
Found Ubuntu 22.04.1 LTS (22.04) on /dev/mapper/vgxubuntu-XR22.04.1U
and leaves the systems mounted rw on /var/lib/os-prober/mount.
On subsequent invocations update-grub spews out multiple
mdir: failed to remove '/var/lib/os-prober/mount': Device or resource busy
I'm pretty sure this also causes a new install to hang (though a
power-reset seems to load the new system - not sure if it is complete
or not.)
The missing umounts should be relatively easy to fix, but the thick
snapshot error is particularly vague as most users (I think) would
take the "unknown filesystem" to refer to the previous entry.
I have been playing with grub2-common-2.06-2ubuntu7 on xubuntu
22.04.1, though I am sure this has been around a while
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1987679/+subscriptions
More information about the foundations-bugs
mailing list