New mounts appear when I create a snapshot

Ever since I upgraded my system to Kubuntu 23.04, extra legacy datasets get mounted when snapshots are created. So to test this, I destroyed all snapshots, then created a snapshot of all my datasets. I then did a apt dist-upgrade which created an automatic snapshot.

Looking through the mounts, there are mounted snapshots:

rpool/ROOT/ubuntu_nbhbt6@230726 on /root/.zfs/snapshot/230726 type zfs (ro,relatime,xattr,noacl)
rpool/ROOT/ubuntu_nbhbt6@autozsys_25nsf3 on /root/.zfs/snapshot/autozsys_25nsf3 type zfs (ro,relatime,xattr,noacl)

plus a weird extra one that I hadn’t set up but appears in zfs mount:

rpool/ROOT/ubuntu_nbhbt6 on /var/snap/firefox/common/host-hunspell type zfs (ro,noexec,noatime,xattr,noacl)

Any suggestions on what’s happening and how I might investigate and fix the unwanted mounts?

rpool/ROOT/ubuntu_nbhbt6@230726 on /root/.zfs/snapshot/230726 type zfs (ro,relatime,xattr,noacl)
rpool/ROOT/ubuntu_nbhbt6@autozsys_25nsf3 on /root/.zfs/snapshot/autozsys_25nsf3 type zfs (ro,relatime,xattr,noacl)

By default, ZFS makes snapshots available via the hidden .zfs directory on each dataset. If you don’t want that, you can disable the behavior with zfs set snapdir=hidden on the datasets you don’t want it to happen on (this is an inheritable property, so if you set it on the root dataset, it’ll cover the whole pool).

rpool/ROOT/ubuntu_nbhbt6 on /var/snap/firefox/common/host-hunspell type zfs (ro,noexec,noatime,xattr,noacl)

Welcome to snaps, this is how they work. :slight_smile:

Each snap is mounted as its own filesystem. Note that this has nothing to do with ZFS–snaps work the same way on ext4.