NFS – 多个子目录 – 只有一个预期的挤压

挂载多个共享时获取意外的行为。

NFS服务器

$ -> cd /mnt/raid/nas && ls -lZa drwxrwxr-x. nas filer unconfined_u:object_r:file_t:s0 file drwxrwxr-x. nas filer unconfined_u:object_r:file_t:s0 repo $ -> cat /etc/exports /mnt/raid/nas 10.1.0.0/18(rw,fsid=0,sync) /mnt/raid/nas/repo 10.1.0.0/18(rw,all_squash,sync,no_subtree_check,anonuid=501,anongid=503) /mnt/raid/nas/file/perm 10.1.0.0/18(rw,all_squash,sync,no_subtree_check,anonuid=501,anongid=503) $ -> id nas && id filer uid=501(nas) gid=501(nas) groups=501(nas) uid=502(filer) gid=503(filer) groups=503(filer) 

NFS客户端

 $ -> id nas && id filer uid=501(nas) gid=501(nas) groups=501(nas) uid=502(filer) gid=503(filer) groups=503(filer) $ -> cd /mnt/nas && ls -lZa drwxrwxr-x. nas filer unconfined_u:object_r:mnt_t:s0 repo drwxrwxr-x. nas filer unconfined_u:object_r:mnt_t:s0 store $ -> sudo mount -t nfs4 nas-1:/repo /mnt/nas/repo $ -> sudo mount -t nfs4 nas-1:/file/perm /mnt/nas/store/file/perm/ $ -> df -h nas-1:/repo 550G 240G 283G 46% /mnt/nas/repo nas-1:/file/perm 550G 240G 283G 46% /mnt/nas/store/file/perm 

但是当我写一个testing文件给每个,只有perm /正确压扁用户。

 $ -> touch /mnt/nas/repo/imagemagick/test_$$.txt $ -> ls /mnt/nas/repo/imagemagick -rw-rw-r--. 1 mpurcell mpurcell 0 Apr 5 20:31 test_24571.txt $ -> touch /mnt/nas/store/file/perm/test_$$.txt $ -> ls /mnt/nas/store/file/perm/ -rw-rw-r--. 1 nas filer 0 Apr 5 20:32 test_24571.txt 

我试过在两个盒子上禁用selinux,但是这也不起作用。

为什么一个挂载正确地挤压用户/组,另一个不是?

—更新—

我必须绑定NFS服务器上的NFS安装吗? 我在我的/ etc / fstab文件中有一个奇怪的条目,其中一个共享目录被挂载(绑定),这是一个工作。 我从NFS服务器上的/ etc / fstab中删除了条目,重新安装了所有内容,现在NFS客户机上的一次工作挂载不再工作。

呃终于得到它的工作,不得不做下面的破解all_squashfunction。 我曾经做过,不记得为什么要这样做,但没有它,我不能得到正确的挤压。

 $ -> ls /mnt/raid/nas drwxrwxr-x. 2 nas filer repo drwxrwxr-x. 3 nas filer repo_all_squash_hack $ -> ls /mnt/raid/nas/file drwxrwxr-x. 2 nas filer perm drwxrwxr-x. 3 nas filer perm_all_squash_hack 

然后在/ etc / fstab中:

 /mnt/raid/nas/file/perm_all_squash_hack /mnt/raid/nas/file/perm none bind 0 0 /mnt/raid/nas/repo_all_squash_hack /mnt/raid/nas/repo none bind 0 0 

现在一切都如预期的那样上升。 也通过确认:

 $ -> cat /proc/fs/nfs/exports /mnt/raid/nas 10.1.0.0/18(rw,root_squash,sync,wdelay,no_subtree_check,fsid=0,uuid=d962b590:d8986203:00000000:00000000,sec=1) /mnt/raid/nas/repo 10.1.0.0/18(rw,root_squash,all_squash,sync,wdelay,no_subtree_check,anonuid=501,anongid=503,uuid=d962b590:d8986203:00000000:00000000,sec=1) /mnt/raid/nas/file/perm 10.1.0.0/18(rw,root_squash,all_squash,sync,wdelay,no_subtree_check,anonuid=501,anongid=503,uuid=d962b590:d8986203:00000000:00000000,sec=1)