Sharing and Unsharing ZFS File Systems
The Oracle Solaris 11.1 release simplifies ZFS share administration by leveraging ZFS property inheritance. The new share syntax is enabled on pools running pool version 34.
The following are the file system packages for NFS and SMB:
-
NFS client and server packages
-
service/file-system/nfs
(server) -
service/file-system/nfs
(client)
For additional NFS configuration information, see Managing Network File Systems in Oracle Solaris 11.4 .
-
-
SMB client and server packages
-
service/file-system/smb
(server) -
service/file-system/smb
(client)
For additional SMB configuration information including SMB password management, see Managing SMB Mounts in Your Local Environment in Managing SMB File Sharing and Windows Interoperability in Oracle Solaris 11.4 .
-
Multiple shares can be defined per file system. A share name uniquely identifies each share. You can define the properties that are used to share a particular path in a file system. By default, all file systems are unshared. In general, the NFS server services are not started until a share is created. If you create a valid share, the NFS services are started automatically. If a ZFS file system's mountpoint
property is set to legacy, the file system can only be shared by using the legacy share
command.
-
The
share.nfs
property replaces thesharenfs
property in previous releases to define and publish an NFS share. -
The
share.smb
property replaces thesharesmb
property in previous releases to define and publish an SMB share. -
Both the
sharenfs
property andsharesmb
property are aliases to theshare.nfs
property and thesharenfs
property. -
The
/etc/dfs/dfstab
file is no longer used to share file systems at boot time. Setting these properties share file systems automatically. SMF manages ZFS or UFS share information so that file systems are shared automatically when the system is rebooted. This feature means that all file systems whosesharenfs
orsharesmb
property are not set to off are shared at boot time. -
The
sharemgr
interface is no longer available. The legacyshare
command is still available to create a legacy share. See the examples below. -
The
share -a
command is like the previousshare -ap
command so that sharing a file system is persistent. Theshare -p
command is no longer available.
For example, if you want to share the tank/home
file system, use syntax similar to the following:
$ zfs set share.nfs=on tank/home
In preceding example, where the share.nfs
property is set on the tank/home
file system, the share.nfs
property value is inherited to any descendent file systems. For example:
$ zfs create tank/home/userA $ zfs create tank/home/userB
You can also specify additional property values or modify existing property values on existing file system shares. For example:
$ zfs set share.nfs.nosuid=on tank/home/userA $ zfs set share.nfs=on tank/home/userA