如何避免多个用户通过NFS导出的ZFS挂载点的长列表?

我们运行的群集大约有50个映射为Linux组的用户组。 每个组都有一个从通过NFS导出的ZFS存储服务器分配的文件系统。 这会导致需要通过NFS客户机节点挂载的很长的挂载点列表。 同样, df -h的输出也很长,列出了每个用户组的所有挂载点。 有没有办法通过某种方式来重build或重新configurationZFS服务器,同时仍然有效地pipe理用户组,例如配额,访问权限等。

以下是zfs list命令的部分输出:

 ~]# zfs list NAME USED AVAIL REFER MOUNTPOINT intp1 43.7G 47.9T 219K /zfs/1 intp1/sam 43.7G 47.9T 219K /zfs/1/sam intp1/harry 219K 4.00T 219K /zfs/1/harry intp1/rick 219K 4.00T 219K /zfs/1/rick intp1/kim 43.7G 3.96T 43.7G /zfs/1/kim intp2 252G 47.7T 252G /zfs/2 intp2/johnson 219K 8.00T 219K /zfs/2/johnson intp2/hoekstra 219K 8.00T 219K /zfs/2/hoekstra 

下面显示的是一个文件系统的zfs get all命令的输出:

 # zfs get all intp1/sam NAME PROPERTY VALUE SOURCE intp1/sam type filesystem - intp1/sam creation Fri Sep 23 9:56 2016 - intp1/sam used 43.7G - intp1/sam available 47.9T - intp1/sam referenced 219K - intp1/sam compressratio 5.42x - intp1/sam mounted yes - intp1/sam quota none default intp1/sam reservation none default intp1/sam recordsize 128K default intp1/sam mountpoint /zfs/1/sam inherited from intp1 intp1/sam sharenfs on inherited from intp1 intp1/sam checksum on default intp1/sam compression lz4 inherited from intp1 intp1/sam atime on default intp1/sam devices on default intp1/sam exec on default intp1/sam setuid on default intp1/sam readonly off default intp1/sam zoned off default intp1/sam snapdir hidden default intp1/sam aclinherit restricted default intp1/sam canmount on default intp1/sam xattr on default intp1/sam copies 1 default intp1/sam version 5 - intp1/sam utf8only off - intp1/sam normalization none - intp1/sam casesensitivity sensitive - intp1/sam vscan off default intp1/sam nbmand off default intp1/sam sharesmb off default intp1/sam refquota none default intp1/sam refreservation none default intp1/sam primarycache all default intp1/sam secondarycache all default intp1/sam usedbysnapshots 0 - intp1/sam usedbydataset 219K - intp1/sam usedbychildren 43.7G - intp1/sam usedbyrefreservation 0 - intp1/sam logbias latency default intp1/sam dedup off default intp1/sam mlslabel none default intp1/sam sync standard default intp1/sam refcompressratio 1.00x - intp1/sam written 219K - intp1/sam logicalused 198G - intp1/sam logicalreferenced 40K - intp1/sam filesystem_limit none default intp1/sam snapshot_limit none default intp1/sam filesystem_count none default intp1/sam snapshot_count none default intp1/sam snapdev hidden default intp1/sam acltype off default intp1/sam context none default intp1/sam fscontext none default intp1/sam defcontext none default intp1/sam rootcontext none default intp1/sam relatime off default intp1/sam redundant_metadata all default intp1/sam overlay off default 

crossmnt使用crossmnt NFS导出选项。

例如:

 /home *(rw,crossmnt,sec=krb5:krb5i:krb5p) 

exports(5)手册页:

该选项类似于nohide但它使客户端可以访问挂载在标有crossmnt的文件系统上的所有文件系统。 因此,当一个子文件系统“B”安装在父“A”上时,在“A”上设置crossmnt与在B上设置“nohide”类似。

nohide子文件系统需要显式导出。 用crossmnt它不需要。 如果crossmnt文件的子项没有显式导出,那么除了fsid=之外,它将隐含地使用与父项相同的导出选项导出。 这使得不能导出一个crossmnt文件系统的孩子。 如果要导出父项的一些但不是全部下级文件系统,则必须显式导出它们,并且不应该设置父crossmnt