LXD + ZFS: Error: Error deleting storage volume: Failed to run: zfs destroy <...> no mount point specified

Hello,
I’m trying to delete LXC:

lxc delete s1-n6
Error: Error deleting storage volume: Failed to run: zfs destroy -r ananas/LXD/containers/s1-n6: umount: /var/snap/lxd/common/shmounts/storage-pools/default/containers/s1-n6: no mount point specified.
cannot unmount '/var/snap/lxd/common/shmounts/storage-pools/default/containers/s1-n6': umount failed

I’ve tried:

sudo nsenter -t $(cat /var/snap/lxd/common/lxd.pid) -m
umount -v /var/snap/lxd/common/shmounts/storage-pools/default/containers/s1-n4
umount: /var/snap/lxd/common/shmounts/storage-pools/default/containers/s1-n4: no mount point specified.

But it’s mounted.

sudo nsenter -t $(cat /var/snap/lxd/common/lxd.pid) -m
mount | grep s1-n6
ananas/LXD/containers/s1-n6 on /var/snap/lxd/common/shmounts/storage-pools/default/containers/s1-n6 type zfs (rw,relatime,xattr,posixacl)

I’ve tried to umount this dataset via umount both inside and outside of the LXD namespace, also with zfs umount outside of the LXD namespace, but it doesn’t helped.

What’s wrong and how to solve it?
Thank you.

1 Like

It is likely overmounted.

If you look at the mount table in the namespace (through mount or /proc/mounts) and go through it in order, you’ll likely find a mount entry after the one for that container which covers one of its parent path.

This effectively hides the mountpoint and prevents you from unmounting it.
If you then unmount that other mountpoint, the container’s mountpoint will become visible once again and you’ll be able to unmount it.

Thank you.

I’m still encountering this on LXD 5.5. Below is a more detailed example of how to work around this issue until the problem is resolved:

$ lxc stop mycontainer

$ sudo nsenter -t $(cat /var/snap/lxd/common/lxd.pid) -m

-bash-5.0# mount | grep -E 'mycontainer|/var/snap/lxd/common/shmounts'
tank/containers/mycontainer on /var/snap/lxd/common/shmounts/storage-pools/tank/containers/mycontainer type zfs (rw,relatime,xattr,posixacl)
tmpfs on /var/snap/lxd/common/shmounts type tmpfs (rw,relatime,size=1024k,mode=711)
lxcfs on /var/snap/lxd/common/shmounts/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
-bash-5.0# umount -l /var/snap/lxd/common/shmounts/lxcfs
-bash-5.0# umount -l /var/snap/lxd/common/shmounts
-bash-5.0# umount -l /var/snap/lxd/common/shmounts/storage-pools/tank/containers/mycontainer
-bash-5.0# exit

$ lxc start mycontainer
1 Like