Global mount and NFS sharing: working on ZFS snap

I’m trying to generate a ZFS snap from

So far I’m only interested in having a working prototype so I’ve been cutting a few corners, and running the snap in devmode.
The snap contains kernel modules (that I manually loaded using insmod), libraries and executables.

So far I’m able to create a storage pool and mount it, but the mount only appears in the context of the zfs snap, i.e. I can only access the mount through:
sudo snap run --shell zfsonlinux.zfs

Is there a way to get the mount to be global for the whole system? I’ve noticed there’s a mount-observe interface, but nothing like mount-control.

As a follow-up I’d like to share my ZFS file-system through NFS, which currently doesn’t work. I’m suspecting that I’d need to resolve the mount issue first.


All snaps execute in a world where whatever they mount is private to them. The only exception, for now, is the /media directory which is set up in a special way. The udisks2 snap will mount things there in a way that is visible to the rest of the system and to other snaps.

If you use devmode just mount something on /media/zfs (just making this up now) and it should be visible.

Note that due to the fact that this is technically very very tricky this is not something that is controlled by interfaces (at least not yet). We can easily design an interface that allows the mount operation in /media but adding another media-like directory (say /mnt) requires changes that are not a part of the interface code.

1 Like

Thanks for your help @zyga-snapd! That did the job for the mounting.

1 Like