Changing ZFS Share Property Values
You can change share property values by specifying new or modified properties on a file system share. For example, if the read-only property is set when the file system is created, the property can be set to off.
$ zfs create -o share.nfs.ro=\* tank/data $ zfs get share.nfs.ro tank/data NAME PROPERTY VALUE SOURCE tank/data share.nfs.sec.sys.ro * local $ zfs set share.nfs.ro=none tank/data $ zfs get share.nfs.ro tank/data NAME PROPERTY VALUE SOURCE tank/data share.nfs.sec.sys.ro off local
If you create an SMB share, you can also add the NFS share protocol. For example:
$ zfs set share.smb=on tank/multifs $ zfs set share.nfs=on tank/multifs $ grep multifs /etc/dfs/sharetab /tank/multifs tank_multifs nfs sec=sys,rw /tank/multifs tank_multifs smb -
Remove the SMB protocol:
$ zfs set share.smb=off tank/multifs $ grep multifs /etc/dfs/sharetab /tank/multifs tank_multifs nfs sec=sys,rw
You can rename a named share. For example:
$ zfs share -o share.smb=on tank/home/abc%abcshare $ grep abc /etc/dfs/sharetab /tank/home/abc abcshare smb - $ zfs rename tank/home/abc%abcshare tank/home/abc%a1share $ grep abc /etc/dfs/sharetab /tank/home/abc a1share smb -
You can grant sharing access to labeled file systems. In the following example, rpool/export/home
is a labeled file system which is configured to be shared.
$ zfs create -o multilevel=on -o encryption=on rpool/ftp-files $ zfs set =/ftpsource rpool/ftp-files $ setlabel "Conf - Internal Use Only" /ftpsource $ zfs set share.nfs.labeled=on rpool/ftp-files $ zfs set share.nfs=on rpool/ftp-files
You can also enable sharing of labeled file systems with the zfs share
command.
$ zfs share -o nfs=on -o share.nfs.labeled=on rpool/ftp-files