Solved NFSv4 and ZFS

I'm trying to enable NFSv4 with ZFS.

/etc/rc.conf
Code:
mountd_flags: -e
But not set mountd_enable=YES
Code:
nfs_server_enable: YES
nfs_server_flags: -e -t -u -n 2
nfsuserd_enable: YES
nfsv4_server_enable: YES
sysctl
Code:
vfs.nfs.enable_uidtostring = 1
vfs.nfsd.enable_stringtouid = 1

vfs.nfsd.issue_delegations = 1
vfs.nfsd.enable_locallocks = 0
/etc/exports
Code:
V4: /
try command

zfs set sharenfs="-alldirs,-maproot=root,-network=192.168.16.0/24" datastore01/shares

In log
Code:
Jan 19 14:01:02 bsd01 mountd[9886]: bad host on, skipping
Jan 19 14:01:02 bsd01 mountd[9886]: network/host conflict
Jan 19 14:01:02 bsd01 mountd[9886]: bad exports list line '/datastore01/shares  on -alldirs -maproot'
My client show server NFS but not show the folder

I can't understand how to configure the logs and I also don't understand how to configure the acl
 
Last edited by a moderator:
AFAIK when using the modern/intended way of doing NFS+ZFS by using the sharenfs dataset property you no longer need /etc/exports.

 
Code:
Jan 19 14:01:02 bsd01 mountd[9886]: bad host on, skipping
Jan 19 14:01:02 bsd01 mountd[9886]: network/host conflict
Jan 19 14:01:02 bsd01 mountd[9886]: bad exports list line '/datastore01/shares  on -alldirs -maproot'
Jan 19 16:48:12 bsd01 mountd[10610]: can't open /etc/exports
Jan 19 16:48:13 bsd01 mountd[10610]: can't get address info for host on
Jan 19 16:48:13 bsd01 mountd[10610]: bad host on, skipping
Jan 19 16:48:13 bsd01 mountd[10610]: can't get address info for host 192.168.16.0/24
Jan 19 16:48:13 bsd01 mountd[10610]: bad host 192.168.16.0/24, skipping
Jan 19 16:48:13 bsd01 mountd[10610]: bad exports list line '/datastore01/shares on -maproot': no valid entries
Jan 19 16:48:13 bsd01 mountd[10610]: NFSv4 requires at least one V4: line
 
Last edited by a moderator:
Now it works thanks I was wrong with some sharenfs options and the client doesn't read the list of folders you have to set the folder manually when it runs the scan it doesn't see anything

However, I had to create the /etc/exports file containing :V4 / the log reports its absence
 
However, the problem in the zfs command set sharenfs='on,-maproot=root,%subnet' %mypoll%/%mydataset% is actually written like this

zfs set sharenfs=on so everyone is active if you specify other attributes on is not necessary. zfs set sharenfs="maproot=root,network=%subnet" %mypool%/mydataset% character - throws error
 
Back
Top