Sample Header Ad - 728x90

What's the sharenfs syntax for using a netgroup with ZFS on Linux?

3 votes
0 answers
761 views
I'm trying to set up an NFS share with a new ZFS dataset (pool/data) and trying to share using an existing netgroup (foogroup). Running Ubuntu 20.04 on both the NFS server side and client side, it works fine if I specify a host or IP subnet, but it fails silently if I try to use a netgroup. I know the underlying netgroup is working if I use /etc/exports instead of sharenfs. I used showmount -e to verify both methods /etc/exports (it correctly shows the netgroup) and sharenfs (does not show the netgroup). Works:
cat /etc/exports
/export/ftp @foogroup(sync,rw)

# showmount -e
Export list for nfs_server:
/export/ftp @foogroup
Doesn't work w/ sharenfs (/etc/exports contents commented out):
# zfs set sharenfs="rw=@foogroup" pool/data
# showmount -e
Export list for nfs_server:
I did confirm pool/data has mountpoint property set to /export/ftp. I did also confirm if I use IP subnet or hostname syntax works:
# zfs set sharenfs="rw=@10.10.10.0/24" pool/data
Hostname works too:
# zfs set sharenfs="rw=client" pool/data
# showmount -e 
Export list for nfs_server:
/export/ftp client
Am I doing something wrong with the sharenfs syntax? Or is this a bug with ZFS on Linux's implementation of sharenfs? Thanks! UPDATE: I stumbled upon an openzfs bug report () that provided an example of using a netgroup and the syntax is different. The exports man page just says to use netgroups, the syntax is "@group", but the bug report used "@@group" syntax. That worked!
Asked by qman777 (31 rep)
Jun 27, 2023, 03:42 AM
Last activity: Jun 27, 2023, 05:06 PM