|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: SMB and Windows Interoperability Oracle Solaris 11 Information Library|
The SMB server provides a per-share configuration property to support client-side caching for offline files. Although the SMB server enables you to configure this feature, only the client manages client-side caching and access to offline files. You can use the zfs command to configure this feature by setting the csc property for a share.
The following are valid values for the csc property:
manual – Permits clients to cache files from the specified share for offline use as requested by users. However, automatic file-by-file reintegration is not permitted. manual is the default value.
auto – Permits clients to automatically cache files from the specified share for offline use, and permits file-by-file reintegration.
vdo – Permits clients to automatically cache files from the specified share for offline use, permits file-by-file reintegration, and permits clients to work from their local cache even while offline.
disabled – Disables client-side caching for the specified share.
Example 1-1 Configuring Client-Side Caching
The following example shows how to configure client-side caching on shares.
First, create and share a file system. When you are using SMB, it is best practice to create a mixed-mode ZFS file system, which is the default. If you have both NFS and SMB clients using a mixture of different character sets on the same file system, you might also want to set the utf8only property and consider specifying the charset=access-list NFS share property.
The sharesmb property can only be set to on or off. Specifying sharesmb=on during dataset creation shares the dataset with the default share properties.
# zfs create -o utf8only=on -o sharesmb=on tank/zvol # zfs get share tank/zvol NAME PROPERTY VALUE SOURCE tank/zvol share name=tank_zvol,path=/tank/zvol,prot=smb local
If you specify sharesmb=on during dataset creation, the share is automatically created as a default share. The name of the share is based on the share path, where slashes (/) are replaced by underscores (_).
To create a share with non-default values, use the zfs set share command, as shown in the following example:
First, create the dataset.
# zfs create -o utf8only=on tank/zvol
Next, create an SMB share with the name of zvol.
# zfs set share=name=zvol,path=/tank/zvol,prot=smb tank/zvol name=zvol,path=/tank/zvol,prot=smb # zfs get share tank/zvol NAME PROPERTY VALUE SOURCE tank/zvol share name=zvol,path=/tank/zvol,prot=smb local
Then, enable SMB sharing on the tank/zvol dataset, and view the active shares on the system.
# zfs set sharesmb=on tank/zvol # cat /etc/dfs/sharetab /tank/zvol zvol smb -
The following command creates a new share, zvol2, with the csc property set to auto:
# zfs set share=name=zvol2,path=/tank/zvol2,prot=smb,csc=auto tank/zvol2 name=zvol2,path=/tank/zvol2,prot=smb,csc=auto # zfs get share tank/zvol2 NAME PROPERTY VALUE SOURCE tank/zvol2 share name=zvol2,path=/tank/zvol2,prot=smb,csc=auto local
Using the zfs command enables you to add properties to a share without specifying all the other previously specified properties and their values.
In the following example, the first command creates a share with the name of zvol3. The second command adds the csc property. In the second command, you do not need to specify the path property because it was already specified in the first command.
# zfs set share=name=zvol3,path=/tank/zvol3,prot=smb tank/zvol3 name=zvol3,path=/tank/zvol3,prot=smb # zfs set share=name=zvol3,prot=smb,csc=auto tank/zvol3 name=zvol3,prot=smb,csc=auto
To add an SMB property with the zfs command, specify the share name (name=zvol3), the protocol (prot=smb), and the new property (csc=auto).
You can also set the csc property on autohome shares in the smbautohome map. As with the ZFS share property, multiple property-value pairs can be specified in a comma-separated list. The following smbautohome map disables client-side caching by default, but sets csc=auto for /export/home/john:
* /export/home/& csc=disabled,description=& john /export/home/& csc=auto,dn=oracle,dn=com,ou=users