Bug#680084: postinst script gets stuck
tags 680084 + patch
thanks
intrigeri wrote (30 Sep 2012 09:42:14 GMT) :
> I can see that too with os-prober installed.
TL;DR ---> see patch at the bottom of this message.
I retried, and I did not see that *the first time*.
First time log:
$ pgrep -l grub-mount
$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
grub-probe: error: no such disk.
done
$ pgrep -l grub-mount
1468 grub-mount
Second time in a row log:
$ pgrep -l grub-mount
1468 grub-mount
$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy
rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy
grub-probe: error: no such disk.
done
$ sudo mountpoint /var/lib/os-prober/mount
/var/lib/os-prober/mount is not a mountpoint
$ pgrep -l grub-mount
1468 grub-mount
2217 grub-mount
I see that /usr/bin/os-prober starts by running
/usr/lib/os-prober/newns, so perhaps the dangling mounts that make the
device busy can not be seen in the default namespace.
Let's test with os-prober only.
$ pgrep -l grub-mount
$ sudo os-prober
fuse: warning: library too old, some operations may not not work
error: unknown filesystem.
mount: unknown filesystem type 'linux_raid_member'
fuse: warning: library too old, some operations may not not work
grub-probe: error: no such disk.
$ pgrep -l grub-mount
6752 grub-mount
$ sudo os-prober
fuse: warning: library too old, some operations may not not work
rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy
error: unknown filesystem.
mount: unknown filesystem type 'linux_raid_member'
rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy
fuse: warning: library too old, some operations may not not work
grub-probe: error: no such disk.
$ pgrep -l grub-mount
6752 grub-mount
7259 grub-mount
Additional information:
The LVM logical volume that is left mounted by os-prober / grub-mount
after the first run is not listed in /etc/fstab.
If I entirely zero that LV, then update-grub works flawlessly twice in
a row, and does not leave dangling grub-mount processes around.
This LV contains a vfat filesystem, that I can perfectly well mount
and umount with mount(8) and umount(8).
Trying to grub-mount it manually:
$ sudo grub-mount /dev/mapper/$VGNAME-$LVNAME /mnt/tmp
fuse: warning: library too old, some operations may not not work
=> a detached process with the same command-line is left running.
$ sudo grub-probe -d /dev/mapper/$VGNAME-$LVNAME -t fs
grub-probe: error: cannot find a GRUB drive for
/dev/$VGNAME/$LVNAME. Check your device.map.
zsh: exit 1
> what does /dev/mapper/vg<whatever> actually point to?
It points to ../dm-5, just like /dev/$VGNAME/$LVNAME.
I've run os-prober with "set -x" + echo to debug further. It appears
that the following patch is needed to deal with the fact grub-probe
returns a non-zero exit code on that device:
--- /home/intrigeri/tmp/50mounted-tests.orig 2012-09-17 17:08:12.000000000 +0200
+++ /usr/lib/os-probes/50mounted-tests 2012-10-26 12:40:34.660238265 +0200
@@ -50,7 +50,7 @@
type grub-probe >/dev/null 2>&1 && \
grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
mounted=1
- type="$(grub-probe -d "$partition" -t fs)"
+ type="$(grub-probe -d "$partition" -t fs)" || true
if [ "$type" ]; then
debug "mounted using GRUB $type filesystem driver"
else
... else, this script exits, umount is never run, and a dangling
grub-mount process is left behind.
Cheers!
--
intrigeri
Reply to: