Setting up an SMB share from Solaris
My Environment
SMB Server: blackhole.dfusion.com.au (Solaris 10 – specifically 5.11, NexentaOS_20090926)Client: Apple OS X Leopard (10.5.8)
Server Configuration
Prior to Solaris 10, Samba was only available as an add-on Open Source package.
Starting with Solaris 10, SMB ability is built into the OS.
This page only covers Solaris 10.
Documents
- OpenSolaris Admin Guides
Specifically Solaris CIFS Administration Guide
- man smb
- man smbadm
For my purposes SMB == SMBFS == Samba == CIFS
Steps
1) Check is SMB is running on the server:
svcs |grep smb online Nov_16 svc:/network/smb/client:default online Nov_16 svc:/network/smb/server:default
If not use
svcadm enable ... to start the server at least.2)Export a share with options
For non ZFS I assume the relevant command is:share -F smbfs -o OPTIONS FILESYSTEMFor ZFS the command is:
zfs set sharesmb=OPTIONS FILESYSTEMOr one can use
sharemgrwhere OPTIONS is the same in both cases. See the Sun administration guide for options.
The options of immediate interest are:
- on
- Just turns SMB on with defaults
- off
- Disable SMB sharing. To just remove any settings for a specific share
- name=share_name
- What the share appears as to clients. Eg a client's URI would be
smb:// server/share_name. Default name for tank/backup is tank_backup (ie '/' replaced by '_') - rw[=opts]
- read/write access. Default is rw for everyone. Refer man page. eg
- ro[=opts]
- read only access (to all if specified, else just to specified list
Example
zfs get sharesmb # to see the current state of play
zfs set sharesmb=name=backup,rw=@192.168 tank/backup
zfs get sharesmb [[tank/backup] # to see the changes
NAME PROPERTY VALUE SOURCE
tank/backup sharesmb name=backup,rw=@192.168 local
sharemgr show -vp # another way to show what is actually shared
default nfs=()
zfs
/tank/backup
backup=/tank/backup smb=(rw="@192.168")- + : A leading plus sign indicates that this word must be present in every object returned.
- - : A leading minus sign indicates that this word must not be present in any row returned.
- By default (when neither plus nor minus is specified) the word is optional, but the object that contain it will be rated higher.
- < > : These two operators are used to change a word's contribution to the relevance value that is assigned to a row.
- ( ) : Parentheses are used to group words into subexpressions.
- ~ : A leading tilde acts as a negation operator, causing the word's contribution to the object relevance to be negative. It's useful for marking noise words. An object that contains such a word will be rated lower than others, but will not be excluded altogether, as it would be with the - operator.
- * : An asterisk is the truncation operator. Unlike the other operators, it should be appended to the word, not prepended.
- " : The phrase, that is enclosed in double quotes ", matches only objects that contain this phrase literally, as it was typed.

