#945289 grub-common: grub-mount stuck on lvm snapshot partition

Package:
grub-common
Source:
grub2
Description:
GRand Unified Bootloader (common files)
Submitter:
Bruno Muller
Date:
2019-11-22 16:00:05 UTC
Severity:
normal
#945289#5
Date:
2019-11-22 15:56:00 UTC
From:
To:
Dear Maintainer,

I'm doing tests to use LVM snapshots to go back in case of apt dist-upgrade
errors and I'm having a problem when a new kernel version is installed:
I can not remove the snapshot because of a grub-mount.

You can reproduce the problem as follows:

root@sid:~# lvcreate -s -n snap -l 100%FREE /dev/sid-vg/root
  Logical volume "snap" created.
root@sid:~# dpkg-reconfigure linux-image-5.3.0-2-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.3.0-2-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.3.0-2-amd64
Found initrd image: /boot/initrd.img-5.3.0-2-amd64
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
grub-probe : erreur : système de fichiers inconnu.
/usr/sbin/grub-probe : erreur : système de fichiers inconnu.
Found Debian GNU/Linux bullseye/sid on /dev/mapper/sid--vg-snap
done
root@sid:~# lvremove -f /dev/sid-vg/snap
  Logical volume sid-vg/snap in use.
root@sid:~# lsblk
NAME                  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                    11:0    1 1024M  0 rom
vda                   254:0    0   20G  0 disk
├─vda1                254:1    0  243M  0 part /boot
├─vda2                254:2    0    1K  0 part
└─vda5                254:5    0 19,8G  0 part
  ├─sid--vg-swap_1    253:1    0    4G  0 lvm  [SWAP]
  ├─sid--vg-root-real 253:2    0 11,8G  0 lvm
  │ ├─sid--vg-root    253:0    0 11,8G  0 lvm  /
  │ └─sid--vg-snap    253:4    0 11,8G  0 lvm
  └─sid--vg-snap-cow  253:3    0    4G  0 lvm
    └─sid--vg-snap    253:4    0 11,8G  0 lvm
root@sid:~# lsof | grep 253,4
grub-moun 5276                           root    3r      BLK              253,4 0t37715968      19527 /dev/dm-4
root@sid:~# ps auxww | grep 5276
root        5276  0.0  0.0  11652  1744 ?        Ss   16:17   0:00 grub-mount /dev/mapper/sid--vg-snap /var/lib/os-prober/mount
root        5316  0.0  0.0   6084   912 pts/0    S+   16:19   0:00 grep 5276
root@sid:~# kill 5276
root@sid:~# lvremove -f /dev/sid-vg/snap
  Logical volume "snap" successfully removed

Tell me if you need more information or if I can help you.
Thank you

Bruno Muller