sharemgr and ZFS

While there is still some refinement occurring in how sharemgr and ZFS interact, there is already quite a bit of integration. There are two ways that ZFS file systems may be shared. The traditional method of using share (and now sharemgr) is fully supported and will behave like any other file system that is shared. Alternatively, there is the "sharenfs" property method. If a ZFS dataset is shared by setting the sharenfs property on the dataset, ZFS will manage the share(s).

This article will outline how ZFS managed shares interact with the sharemgr framework.

The first thing to note about ZFS shares is that they appear as sub-groups within the zfs group. For example, if you have a dataset tank/shares that is shared via the sharenfs property

    zfs set sharenfs=rw,nosuid tank/shares

this will show up in a sharemgr show as:

    sharemgr show -vp zfs
    zfs nfs=(nosuid) nfs:sys=(rw=\*)
        zfs/tank/shares
          /tank/shares

If additional file systems are created within tank/shares, they are automatically shared and appear in the same sub-group. For example:

zfs create tank/shares/user01
zfs create tank/shares/user02
sharemgr show -vp
zfs nfs=(nosuid)
nfs:sys=(rw=\*)
    zfs/tank/shares
       /tank/shares
       /tank/shares/user01
       /tank/shares/user02

You can change NFS properties using either the same zfs command to change sharenfs, or you can use sharemgr to make the changes. For example, if you want to restrict the above example to being read-only for hosts host1 and host2, you can use sharemgr:

    sharemgr set -S sys -p ro=host1:host2 zfs/tank/shares

or you can use the zfs command:

    zfs set sharenfs=rw,ro=host1:host2,nosuid tank/shares

As the property lists get more complex, the sharemgr approach becomes simpler and less error prone than the zfs command-line due to not having to construct the entire list of options each time a change needs to be made.

Over time, there will be tighter integration between ZFS and sharemgr and ZFS. The next optimization will be to change the zfs command to call directly into the sharemgr API rather than doing a popen() of the share command for each share.

Comments:

Were u in MD?

Posted by Erin on March 28, 2007 at 09:37 AM MDT #

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

dougm

Search

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