4

Running OpenIndiana 2020. Issuing zfs get sharenfs lists all NFS shares for the most part. But how can I see if any subdirectories have been shared with different properties? Selecting a filesystem from the list, e.g. tank1/testset and using zfs get sharenfs tank1/testset only lists the parent status again.

admin@oi2:~$ zfs get sharenfs tank1/testset
NAME              PROPERTY  VALUE     SOURCE
tank1/testset     sharenfs  on        local

I essentially want to return the information set in a command like the following example:

zfs set share=name=pp,path=/pub,prot=nfs,sec=sys,rw=*,public rpool/public

cat /etc/dfs/sharetab Does not list detailed info (particularly IP addresses) set in the "rw" field.

Issuing simply share lists

testset@tank1/ /tank1/testset rw ""

but no additional information. Does this mean there are no rw permissions set on this share?

Issuing sharemgr show results in:

default
smb
          /var/smb/cvol
zfs
    zfs/tank1
          /tank1
    zfs/tank1/testset
          /tank1/testset

For example I issued share -o rw=@192.168.23.0,root=@192.168.23.0 /tank1/testset but have no idea how to see this information after it has been set.

DrKumar
  • 171
  • 7
  • What happens with `zfs get sharenfs` – ewwhite Oct 31 '20 at 04:54
  • @ewwhite it lists all shares, their NFS status "Value" (on/off), and Souce (local/inherited from tank1, etc). But perhaps I am looking for file/directory ACLs rather than share info? – DrKumar Oct 31 '20 at 04:57

2 Answers2

1

I''m not sure on Solaris but on Linux you can view the NFS properties of a ZFS dataset with

cat /etc/exports.d/zfs.exports

or

 cat /etc/zfs/exports 
1

On Solaris 11.4, zfs get export does recursively list all NFS shares without showing every sharenfs properly for every filesystem and snapshot:

# zfs get share
NAME                   PROPERTY  VALUE  SOURCE
export/backups         share     name=export_backups,path=/export/backups,prot=nfs,sec=default,root=@192.168  local
export/home            share     name=export_home,path=/export/home,prot=nfs,sec=default  local
export/home/ahenle     share     name=export_home_ahenle,path=/export/home/ahenle,prot=nfs,sec=default  local
export/home/...        share     name=export_home_...,path=/export/home/...,prot=nfs,sec=default  local
export/home/...        share     name=export_home_...,path=/export/home/...,prot=nfs,sec=default  local
export/home/...        share     name=export_home_...,path=/export/home/...,prot=nfs,sec=default  local
Andrew Henle
  • 1,262
  • 9
  • 11