First use of sharemgr

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.

Comments:

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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
    
       
Today