The sharesmb property is provided to share ZFS files by using the Solaris CIFS software product. When this property is set on a ZFS file system, these shares are visible to CIFS client systems. For more information about using the CIFS software product, see the System Administration Guide: Windows Interoperability.
For a detailed description of the sharesmb property, see The sharesmb Property.
In this example, a ZFS file system sandbox/fs1 is created and shared with the sharesmb property. If necessary, enable the SMB services.
# svcadm enable -r smb/server svcadm: svc:/milestone/network depends on svc:/network/physical, which has multiple instances. # svcs | grep smb online 10:47:15 svc:/network/smb/server:default |
# zpool create sandbox mirror c0t2d0 c0t4d0 # zfs create sandbox/fs1 # zfs set sharesmb=on sandbox/fs1 |
The sharesmb property is set for sandbox/fs1 and its descendents.
Verify that the file system was shared. For example:
# sharemgr show -vp
default nfs=()
zfs nfs=()
zfs/sandbox/fs1 smb=()
sandbox_fs1=/sandbox/fs1
|
A default SMB resource name, sandbox_fs1, is assigned automatically.
In this example, another file system is created, sandbox/fs2, and shared with a resource name, myshare.
# zfs create sandbox/fs2
# zfs set sharesmb=name=myshare sandbox/fs2
# sharemgr show -vp
default nfs=()
zfs nfs=()
zfs/sandbox/fs1 smb=()
sandbox_fs1=/sandbox/fs1
zfs/sandbox/fs2 smb=()
myshare=/sandbox/fs2
|
The sandbox/fs2/fs2_sub1 file system is created and is automatically shared. The inherited resource name is myshare_fs2_sub1.
# zfs create sandbox/fs2/fs2_sub1
# sharemgr show -vp
default nfs=()
zfs nfs=()
zfs/sandbox/fs1 smb=()
sandbox_fs1=/sandbox/fs1
zfs/sandbox/fs2 smb=()
myshare=/sandbox/fs2
myshare_fs2_sub1=/sandbox/fs2/fs2_sub1
|
Disable SMB sharing for sandbox/fs2 and its descendents.
# zfs set sharesmb=off sandbox/fs2
# sharemgr show -vp
default nfs=()
zfs nfs=()
zfs/sandbox/fs1 smb=()
sandbox_fs1=/sandbox/fs1
|
In this example, the sharesmb property is set on the pool's top-level file system. The descendent file systems are automatically shared.
# zpool create sandbox mirror c0t2d0 c0t4d0 # zfs set sharesmb=on sandbox # zfs create sandbox/fs1 # zfs create sandbox/fs2 |
The top-level file system has a resource name of sandbox, but the descendents have their dataset name appended to the resource name.
# sharemgr show -vp
default nfs=()
zfs nfs=()
zfs/sandbox smb=()
sandbox=/sandbox
sandbox_fs1=/sandbox/fs1 smb=()
sandbox_fs2=/sandbox/fs2 smb=()
|