« August 2008
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today

FEEDS

SEARCH



LINKS




CONTACT
Doug McCallum
Template by
Helquin


Today's hits: 25
Wednesday Jan 17, 2007

Introduction to sharemgr

This is the first in a series of posts about the new NFS management facility called "sharemgr" that is now part of OpenSolaris.

Sharemgr is a new framework for managing shared files that makes extensive use of the SMF facility. All configuration information is kept in the SMF configuration repository although backward compatibility with the /etc/dfs/dfstab configuration file is maintained. Also, the traditional share/unshare commands continue to work but have been reimplemented using the sharemgr framework.

All management functions are handled through the command line. Having a command to perform all management operations simplifies tasks. Directly editing the /etc/dfs/dfstab file is discouraged, although it will continue to work for now.

Along with using the SMF repository for storing the configuration information for shares, sharemgr introduces the concept of "share groups". A share group is a collection of shares that have common sets of options or that need to be grouped for management reasons. Each share group is implemented as an SMF service instance. The "default" instance implements the traditional configuration that previously existed in /etc/dfs/dfstab.

An example of where share groups could be useful is in managing home directories. In this case, most, if not all, of the shares would have the same properties set. With sharemgr you could create a group "homedirs", set the operational properties on the group and then add the shares. All the shares inherit the properties set on the group. If you later decide to change the properties on all home directories, you change them on the group and the shares get updated. The sequence of commands would be:

sharemgr create homedirs
sharemgr set -P nfs -p nosuid=true homedirs
sharemgr add-share -s /export/home/user01 homedirs
sharemgr add-share -s /export/home/user02 homedirs
...
sharemgr add-share -s /export/home/user10
sharemgr show -vp homedirs
homedirs nfs=(nosuid=true)

/export/home/user01
/export/home/user02
...
/export/home/user10

If you later want to enable "sys" security with some read only hosts but all others are read/write, you can add it to the group with:

sharemgr set -P nfs -S sys -p rw="*" -p ro=host1:host2 homedirs
sharemgr show -vp homedirs
homedirs nfs=(nosuid=true) nfs:sys=(rw=* ro=host1:host2)
/export/home/user01
/export/home/user02
...
/export/home/user10

It is also possible to enable or disable a share group. A share group that has been disabled won't automatically be shared on reboot.

The full set of sub-commands for sharemgr are:
usage: sharemgr [-h | [options]]
sub-commands:
add-share [-nth] [-r resource-name] [-d "description text"] -s sharepath group
create [-nvh] [-P proto [-p property=value]] group
delete [-nvh] [-P proto] [-f] group
disable [-nvh] {-a | group ...}
enable [-nvh] {-a | group ...}
list [-vh] [-P proto]
move-share [-nvh] -s sharepath destination-group
remove-share [-fnvh] -s sharepath group
set [-nvh] -P proto [-S optspace] [-p property=value]* [-s sharepath] group
set-share [-nh] [-r resource] [-d "description text"] -s sharepath group
show [-pvxh] [-P proto] [group ...]
share [-F fstype] [-p] [-o optionlist][-d description] [pathname [resourcename]]
unset [-nvh] -P proto [-S optspace] [-p property]* group
unshare [-F fstype] [-p] [-o optionlist] sharepath

Comments:

Post a Comment:
Comments are closed for this entry.