Managing ZFS File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: December 2014
 
 

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.

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 the sharenfs property in previous releases to define and publish an NFS share.

  • The share.smb property replaces the sharesmb property in previous releases to define and publish an SMB share.

  • Both the sharenfs property and sharesmb property are aliases to the share.nfs property and the sharenfs 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 whose sharenfs or sharesmb property are not set to off are shared at boot time.

  • The sharemgr interface is no longer available. The legacy share command is still available to create a legacy share. See the examples below.

  • The share –a command is like the previous share –ap command so that sharing a file system is persistent. The share –p option 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