通过 NFS 访问 ZFS 快照时权限错误(Solaris 服务器,Ubuntu 客户端)

通过 NFS 访问 ZFS 快照时权限错误(Solaris 服务器,Ubuntu 客户端)

TL;DR:我不明白为什么我可以访问一个文件但不能访问另一个文件(在同一个目录中),尽管它们似乎具有相同的权限。


我有一个运行 Solaris 10 10/08 的 NFS 服务器和一个运行 Ubuntu 12.04 的客户端。我像这样挂载 ZFS 快照:

# mount | grep homes
server:/homes/.zfs/snapshot on /u/homes type nfs (ro,noatime,vers=3,intr,sloppy,addr=1.2.3.4)

然后我查看这两个文件/u/homes

# ls -l 1.txt 2.txt 
-rw-r--r--+ 1 usr grp 2.2K Oct 12 13:42 1.txt
-rw-r--r--+ 1 usr grp 2.1K May 31  2013 2.txt


# stat 1.txt
  File: `1.txt'
  Size: 2170        Blocks: 4          IO Block: 1048576 regular file
Device: 43h/67d Inode: 1621536     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 2428/   usr)   Gid: ( 2000/    grp)
 Birth: -

# stat 2.txt
  File: `2.txt'
  Size: 2146        Blocks: 3          IO Block: 1048576 regular file
Device: 43h/67d Inode: 7975730     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 2428/   usr)   Gid: ( 2000/    grp)
 Birth: -

在服务器上查看相同的文件:

  File: `1.txt'
  Size: 2170            Blocks: 4          IO Block: 2560   regular file
Device: 2d50005h/47513605d      Inode: 1621536     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 2428/ UNKNOWN)   Gid: ( 2000/ UNKNOWN)

  File: `2.txt'
  Size: 2146            Blocks: 3          IO Block: 2560   regular file
Device: 2d50005h/47513605d      Inode: 7975730     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 2428/ UNKNOWN)   Gid: ( 2000/ UNKNOWN)

它们在我看来非常相似。现在,当我尝试从客户端访问它们时,我得到了

# cat 2.txt >/dev/null; echo $?
0
# cat 1.txt >/dev/null; echo $?
cat: 1.txt: Permission denied
1

怎么回事?它们具有相同的权限!我还在snoop服务器端对 NFS 数据包进行了 -ed 处理,通信没有任何差异(数据包长度、校验和、时间戳等除外),但一个文件返回

NFS:  Access = read 

和另一个

NFS:  Access =

怎么会这样?我做错了什么?

编辑1

# zfs get all homes | sort
NAME   PROPERTY              VALUE                       SOURCE
homes  aclinherit            restricted                  default
homes  aclmode               groupmask                   default
homes  atime                 on                          default
homes  available             1.36T                       -
homes  canmount              on                          default
homes  casesensitivity       sensitive                   -
homes  checksum              on                          default
homes  compression           on                          inherited from homes
homes  compressratio         1.57x                       -
homes  copies                1                           default
homes  creation              Mon Aug 17 18:53 2015       -
homes  devices               on                          default
homes  exec                  on                          default
homes  logbias               latency                     default
homes  mounted               yes                         -
homes  mountpoint            /homes                      local
homes  nbmand                off                         default
homes  normalization         none                        -
homes  primarycache          all                         default
homes  quota                 none                        default
homes  readonly              off                         inherited from homes
homes  recordsize            128K                        default
homes  referenced            800G                        -
homes  refquota              none                        default
homes  refreservation        none                        default
homes  reservation           none                        default
homes  secondarycache        all                         default
homes  setuid                on                          default
homes  shareiscsi            off                         default
homes  sharenfs              on                          inherited from homes
homes  sharesmb              off                         default
homes  snapdir               hidden                      default
homes  type                  filesystem                  -
homes  used                  1.31T                       -
homes  usedbychildren        0                           -
homes  usedbydataset         800G                        -
homes  usedbyrefreservation  0                           -
homes  usedbysnapshots       544G                        -
homes  utf8only              off                         -
homes  version               4                           -
homes  vscan                 off                         default
homes  xattr                 on                          default
homes  zoned                 off                         default


# zfs get all homes@backup_2016-01-21 | sort
NAME                      PROPERTY              VALUE                  SOURCE
homes@backup_2016-01-21  casesensitivity       sensitive              -
homes@backup_2016-01-21  compressratio         1.53x                  -
homes@backup_2016-01-21  creation              Thu Jan 21  0:00 2016  -
homes@backup_2016-01-21  defer_destroy         off                    -
homes@backup_2016-01-21  devices               on                     default
homes@backup_2016-01-21  exec                  on                     default
homes@backup_2016-01-21  nbmand                off                    default
homes@backup_2016-01-21  normalization         none                   -
homes@backup_2016-01-21  primarycache          all                    default
homes@backup_2016-01-21  referenced            800G                   -
homes@backup_2016-01-21  secondarycache        all                    default
homes@backup_2016-01-21  setuid                on                     default
homes@backup_2016-01-21  shareiscsi            off                    default
homes@backup_2016-01-21  type                  snapshot               -
homes@backup_2016-01-21  used                  0                      -
homes@backup_2016-01-21  userrefs              0                      -
homes@backup_2016-01-21  utf8only              off                    -
homes@backup_2016-01-21  version               4                      -
homes@backup_2016-01-21  xattr                 on                     default

编辑2

# share
-               /homes   rw   ""  

相关内容