ZFS FreeBSD 10.2 NFS4 setting on zfs sharenfs

Hi
In the previous version of FreeBSD, the NFS4 setting only can be done through the /etc/exports, may I know any success story of configuring NFS4 parameter through the zfs set sharenfs command in FreeBSD 10.2? Any example?
 
As far as I'm aware, the syntax for the exports lines hasn't really changed, so the way the sharenfs option is set, shouldn't be any different to V3.

The only difference, is that you need a V4: line in /etc/exports, to set the root directory for NFSv4 exports. From what I can see, you can have more than one V4: line, to specify different auth options for different hosts/networks, but they must all specify the same path. You can't have more than one NFSv4 root path. This line doesn't actually export anything, it just sets the path that client mounts should be relative to, eg.
Code:
Shared: /some/folder, NFSv4 Root: / -> Client Mounts: server:/some/folder
Shared: /some/folder, NFSv4 Root: /some/folder -> Client Mounts: server:/

There is mention on the forum that the V4 line has to be last, which would be a problem seeing as the ZFS shares are loaded after /etc/exports, but other users say that isn't the case (or at least isn't any more).

So basically, you should just be able to add V4: / to /etc/exports (using whatever NFS root path you want), then share the directories via ZFS as normal.

Considering the V4 option is completely separate to the shares, and only one V4 path is allowed (basically it's a system wide configuration option), I can't see that ever being set any other way than manually in /etc/exports. It wouldn't make sense to set it through the sharenfs property on a dataset.

Or I could be completely wrong.
 
...
So basically, you should just be able to add V4: / to /etc/exports (using whatever NFS root path you want), then share the directories via ZFS as normal.
...
That's right. The V4 just sets the NFSv4 tree root of all the shares. So what you said will set that root and all your zfs shares that get automatically put in /etc/zfs/exports will just work.
 
Back
Top