$ zfs create tank/home/userA $ zfs create tank/home/userB
$ zfs set share.nfs.nosuid=on tank/home/userA $ zfs set share.nfs=on tank/home/userA
$ zfs create rpool/fs1 $ zfs set share=name=fs1,path=/rpool/fs1,prot=nfs rpool/fs1 name=fs1,path=/rpool/fs1,prot=nfs
$ zfs set sharenfs=on rpool/fs1 $ grep fs1 /etc/dfs/sharetab /rpool/fs1 fs1 nfs sec=sys,rw
$ zfs get share rpool/fs1 NAME PROPERTY VALUE SOURCE rpool/fs1 share name=fs1,path=/rpool/fs1,prot=nfs local
$ share -F nfs /tank/zfsfs $ grep zfsfs /etc/dfs/sharetab /tank/zfsfs tank_zfsfs nfs sec=sys,rw
$ zfs create -o share.nfs=on tank/sales [FreeBSD中是sharenfs=on] $ zfs create -o share.nfs.ro=\* tank/sales/logs [FreeBSD中没有sharenfs.ro,此命令应改为:zfs create -o sharenfs=ro\* tank/sale/logs] $ zfs get -r share.nfs tank/sales NAME PROPERTY VALUE SOURCE tank/sales share.nfs on local tank/sales% share.nfs on inherited from tank/sales tank/sales/log share.nfs on inherited from tank/sales tank/sales/log% share.nfs on inherited from tank/sales
$ zfs set share.nfs=on tank/home/data $ zfs set share.nfs.sec.default.root=neo.daleks.com tank/home/data
$ zpool get version tank NAME PROPERTY VALUE SOURCE tank version 33 default $ zfs create -o sharenfs=on tank/home $ zfs create tank/home/userA $ grep tank/home /etc/dfs/sharetab /tank/home tank_home nfs sec=sys,rw /tank/home/userA tank_home_userA nfs sec=sys,r
$ ls -lv /tank/workspace/.zfs/shares -rwxrwxrwx+ 1 root root 0 May 15 10:31 myshare 0:everyone@:read_data/write_data/append_data/read_xattr/write_xattr /execute/delete_child/read_attributes/write_attributes/delete /read_acl/write_acl/write_owner/synchronize:allow
$ zfs get -r share.smb.guestok tank/workspace NAME PROPERTY VALUE SOURCE tank/workspace share.smb.guestok on inherited from tank tank/workspace%myshare share.smb.guestok on inherited from tank
$ zfs create -o share.nfs=on -o share.nfs.anon=99 -o share.auto=off tank/home $ mkdir /tank/home/userA $ mkdir /tank/home/userB $ zfs share -o share.path=/tank/home/userA tank/home%userA $ zfs share -o share.path=/tank/home/userB tank/home%userB $ grep tank/home /etc/dfs/sharetab /tank/home/userA userA nfs anon=99,sec=sys,rw /tank/home/userB userB nfs anon=99,sec=sys,rw
$ zfs create -o mountpoint=/pub tank/public $ zfs share -o share.nfs=on -o share.nfs.public=on tank/public%pubshare $ grep pub /etc/dfs/sharetab /pub pubshare nfs public,sec=sys,rw
$ zfs create -o share.smb=on -o share.autoname=john data/home/john $ zfs create data/home/john/backups $ grep john /etc/dfs/sharetab /data/home/john john smb /data/home/john/backups john_backups smb
$ zfs get share.nfs tank/sales NAME PROPERTY VALUE SOURCE tank/sales share.nfs on local
$ zfs get -r share.nfs tank/sales NAME PROPERTY VALUE SOURCE tank/sales share.nfs on local tank/sales% share.nfs on inherited from tank/sales tank/sales/log share.nfs on inherited from tank/sales tank/sales/log% share.nfs on inherited from tank/sales
$ zfs get share.nfs.all tank/sales NAME PROPERTY VALUE SOURCE tank/sales share.nfs.aclok off default tank/sales share.nfs.anon default tank/sales share.nfs.charset.* ... default tank/sales share.nfs.cksum default tank/sales share.nfs.index default tank/sales share.nfs.log default tank/sales share.nfs.noaclfab off default tank/sales share.nfs.nosub off default tank/sales share.nfs.nosuid off default tank/sales share.nfs.public - - tank/sales share.nfs.sec default tank/sales share.nfs.sec.* ... default
$ zfs get -e -s local,received,inherited share.all tank/home NAME PROPERTY VALUE SOURCE tank/home share.auto off local tank/home share.nfs on local tank/home share.nfs.anon 99 local tank/home share.protocols nfs local tank/home share.smb.guestok on inherited from tank
$ zfs create -o share.nfs.ro=\* tank/data $ zfs get share.nfs.ro tank/data NAME PROPERTY VALUE SOURCE tank/data share.nfs.sec.sys.ro * local $ zfs set share.nfs.ro=none tank/data $ zfs get share.nfs.ro tank/data NAME PROPERTY VALUE SOURCE tank/data share.nfs.sec.sys.ro off local
$ zfs set share.smb=on tank/multifs $ zfs set share.nfs=on tank/multifs $ grep multifs /etc/dfs/sharetab /tank/multifs tank_multifs nfs sec=sys,rw /tank/multifs tank_multifs smb -
$ zfs set share.smb=off tank/multifs $ grep multifs /etc/dfs/sharetab /tank/multifs tank_multifs nfs sec=sys,rw
$ zfs share -o share.smb=on tank/home/abc%abcshare $ grep abc /etc/dfs/sharetab /tank/home/abc abcshare smb - $ zfs rename tank/home/abc%abcshare tank/home/abc%a1share $ grep abc /etc/dfs/sharetab /tank/home/abc a1share smb -
$ zfs create -o multilevel=on -o encryption=on rpool/ftp-files $ zfs set =/ftpsource rpool/ftp-files $ setlabel "Conf - Internal Use Only" /ftpsource $ zfs set share.nfs.labeled=on rpool/ftp-files $ zfs set share.nfs=on rpool/ftp-files
$ zfs unshare tank/home/abc%a1share $ grep abc /etc/dfs/sharetab # $ zfs share tank/home/abc%a1share $ grep abc /etc/dfs/sharetab /tank/home/abc a1share smb -
zfszone$ share -F nfs /export/home/data zfszone# cat /etc/dfs/sharetab
zfszone$ zfs set share.nfs=on tank/zones/export/home/data1 zfszone$ cat /etc/dfs/sharetab
$ zfs get share.nfs filesystem $ zfs get share.smb filesystem
$ zfs get sharenfs filesystem $ zfs get sharesmb filesystem
$ zfs get share NAME PROPERTY VALUE SOURCE tank/data share name=data,path=/tank/data,prot=nfs local
$ zfs get -r share.auto tank/data $ zfs set share.auto=on tank/data
共享状态 | 描述 | 解决方法 |
---|---|---|
INVALID | 该共享无效,因为它在内部不一致或与另一个共享冲突 | 尝试使用以下命令重新共享无效共享:
$ zfs share FS%share
使用此命令将显示有关共享的哪个方面验证失败的错误消息。请更正此问题,然后重试共享。
|
SHARED | 该共享已经共享 | 无需操作 |
UNSHARED | 共享有效但没有共享 | 尝试使用以下命令重新共享无效共享:
使用 |
UNVALIDATED | 该共享尚未验证。包含共享的文件系统可能未处于可共享状态。例如,它未装入或委托给当前区域以外的区域。或者,已创建代表所需共享的ZFS属性,但尚未验证为合法共享。 | 尝试使用以下命令重新共享无效共享:
使用 |