Share properties under sharemgr
By dougm on Feb 06, 2007
Sharemgr uses a different syntax for share property handling than the traditional share command in an effort to provide a more consistent user model. When setting properties, they are always in the property=value form while the traditional share command sometimes used this form and sometimes implied a value. Also, sharemgr deals with each property separately while the traditional share grouped them into a single option string.
For initial setting, the single option string approach isn't really a problem, but if you want to make a change to a single property, you have be careful and reissue the share command with a correctly updated option string. With sharemgr, it is possible to change a single property independently of the other properties.
It should also be noted that the sharemgr "set" sub-command allows changing a single property at a time rather than having to respecify all of the properties. To remove a property, the "unset" sub-command is used. For example:
sharemgr set -P nfs -S sys -p ro="\*" -p rw=host1:host2 test-group
would set the NFS sys security mode with read only for all hosts except host1 and host2 which are read/write. If you later decide that host3 should be read/write, then:
sharemgr set -P nfs -S sys -p rw=host1:host2:host3 test-group
would change rw but leave ro alone. Also note that to set security properties for NFS that it is necessary to use the -S option to set the property space to put the properties in.
Non-negotiated properties such as nosuid and nosub are not placed in one of the alternate property spaces and would be set with:
sharemgr set -P nfs -p nosuid=true test-group
In general, properties can be placed either on the group or on individual shares with properties on a share overriding the same property that is on the group. That is, while shares always inherit properties from the group they are contained in, they can have properties that override them. There is also one property that is only allowed on shares and not on groups -- the "public" property. This is due to there only being one share on a server that may have that property set.
The syntax for setting a property on a share is:
sharemgr set -P nfs -s /share/path -p property=value test-group