This looks a lot like an issue with zfs-linux to me (and *maybe* systemd, not sure about this).
The issue is that the snaps are on /var/lib/snapd/snaps and snapd writes mount units into /etc/systemd/system/ so that the snaps are mounted under /snap/<snapname>/<rev>.
Looking at a zfs-linux system and the "mount" output /var/lib is mounted:
$ mount |grep var/lib
rpool/ROOT/ubuntu_azzm5v/var/lib on /var/lib type zfs (rw,relatime,xattr,posixacl)
and the systemd unit for this mount point is auto-generated:
$ systemctl status var-lib.mount
var-lib.mount - /var/lib
Loaded: loaded (/proc/self/mountinfo)
Active: active (mounted) since Tue 2021-04-06 16:38:58 CEST; 19min ago
Where: /var/lib
What: rpool/ROOT/ubuntu_azzm5v/var/lib
Systemd should order mounts so that var-lib.mount is mounted before What=/var/lib/snapd/... is used. I see a zfs-generator in the zfs-linux source tree that looks like it should generator the mount entries from the pool. However nothing generated in /run/systemd/generator:
We could easily workaround this via Pawels approach above but I feel this will affect more than snapd. Everyone who wants to mount anyting under /var/lib will be affected.
This looks a lot like an issue with zfs-linux to me (and *maybe* systemd, not sure about this).
The issue is that the snaps are on /var/lib/ snapd/snaps and snapd writes mount units into /etc/systemd/ system/ so that the snaps are mounted under /snap/< snapname> /<rev>.
Looking at a zfs-linux system and the "mount" output /var/lib is mounted:
$ mount |grep var/lib ubuntu_ azzm5v/ var/lib on /var/lib type zfs (rw,relatime, xattr,posixacl)
rpool/ROOT/
and the systemd unit for this mount point is auto-generated: self/mountinfo) ubuntu_ azzm5v/ var/lib
$ systemctl status var-lib.mount
var-lib.mount - /var/lib
Loaded: loaded (/proc/
Active: active (mounted) since Tue 2021-04-06 16:38:58 CEST; 19min ago
Where: /var/lib
What: rpool/ROOT/
Systemd should order mounts so that var-lib.mount is mounted before What=/var/ lib/snapd/ ... is used. I see a zfs-generator in the zfs-linux source tree that looks like it should generator the mount entries from the pool. However nothing generated in /run/systemd/ generator:
$ find /run/systemd/ generator generator generator/ netplan. stamp generator/ openvpn. service. wants generator/ local-fs. target. wants generator/ local-fs. target. wants/systemd- remount- fs.service generator/ swap.target. requires generator/ swap.target. requires/ dev-disk- by\x2duuid- 9c43c866\ x2dbe89\ x2d499c\ x2d9300\ x2d098d5dcb0509 .swap generator/ dev-disk- by\x2duuid- 9c43c866\ x2dbe89\ x2d499c\ x2d9300\ x2d098d5dcb0509 .swap generator/ boot-grub. mount generator/ local-fs. target. requires generator/ local-fs. target. requires/ boot-grub. mount generator/ local-fs. target. requires/ boot-efi. mount generator/ boot-efi. mount
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
/run/systemd/
We could easily workaround this via Pawels approach above but I feel this will affect more than snapd. Everyone who wants to mount anyting under /var/lib will be affected.