Skip to content

First use of sharemgr

July 4, 2007

The NFS server that serves our build environment also serves out some legacy UFS/SVM filesystems via the more traditional method. Or at least it used to. Today I wanted to read the contents of the directory via NFS and I gor permission denied. A bit of digging showed that it no longer shared globally with read only access, a bit more and I discovered that it was now being shared using sharemgr(1M) and not in the default share:

So instead of editing the /etc/dfs/dfstab file I can now change the shares for the entire group with one command. The problem I had was figuring exactly what that command was (the bit that took some figuring out was that I needed the -S sys option as we are using the “no security at all” AUTH_SYS on this share which given what it contains is not unreasonable).

# sharemgr list -v  cdfs    enabled nfs default enabled nfs zfs     enabled nfs # sharemgr show -v cdfs  cdfs           /cdbuild/images/temp           /cdbuild/builds           /cdbuild/images/stored           /cdbuild/cdfs # sharemgr show -p cdfs  cdfs nfs=()         /cdbuild/images/temp     nfs:sys=(rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/builds  nfs:sys=(rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/images/stored   nfs:sys=(root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/cdfs    nfs:sys=(root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM") #  # sharemgr set -P nfs -S sys -p ro= cdfs # sharemgr show -p cdfs        cdfs nfs=() nfs:sys=(ro="")         /cdbuild/images/temp     nfs=() nfs:sys=(ro="" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/builds  nfs=() nfs:sys=(ro="" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/images/stored   nfs=() nfs:sys=(ro="" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM:pts-cdrw:pts-cdrw.UK.Sun.COM")         /cdbuild/cdfs    nfs=() nfs:sys=(ro="" root="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM" rw="stomper:stomper.UK.Sun.COM:dvdrhost:dvdrhost.UK.Sun.COM:dvdrhost2:dvdrhost2.UK.Sun.COM") #

How cool is that to be able to change the share options on four file systems with just one command. No more faffing around with an editor trying to do global edits on a file or generating the file from a database.

Advertisements

From → Solaris

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: