export a zfs snapshot over nfs

Rick Macklem rmacklem at uoguelph.ca
Fri Jan 24 22:47:05 UTC 2020


mike tancsa wrote:
>On a backup server, I want to export a zfs snapshot via nfs, but I cant
>seem to do it.
>
>given the snapshot is
>backup2/zrepl/sink2/nfserver1/images/vms at zrepl_20190902_122114_000
>
>I can do something locally like
>
>mkdir /tmpmount
>
>add
>
>/tmpmount       -maproot=nobody   192.168.13.36
>
>and from the client machine mount /tmpmount.
>
>But if I do on the server
>
>mount -t zfs
>backup2/zrepl/sink2/nfserver1/images/vms at zrepl_20190902_122114_000 /tmpmount
>
>and then try and mount from the client, I get a permission denied.
>
>I can work around it by creating a quick clone of the snapshot and
>mounting the clone.  But was curious as to why I cant do it the first way ?
>
>server is releng12 and nfsv3
I am happy to say I never use ZFS, but if I were to guess, it will have something
to do with the fsid of the file system.

NFSv3 mounts do not cross server mount points (which are recognized by a change
in the FSID). I believe that a snapshot appears to be a different file system (ie. different
FSID). ZFS does some sort of weird "pseudo mount" of snapshots, I think?

You did not mention doing a separate export line for the snapshot, which would be
needed to mount it, if it is a different FSID.
--> You could try...
1 - Adding an export line to /etc/exports for the snapshot's directory path.
or
2 - Use an NFSv4 mount of a higher level directory, since NFSv4 does cross server
     mountpoints/FSID changes.

rick

    ---Mike


_______________________________________________
freebsd-fs at freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"


More information about the freebsd-fs mailing list