无法打开 NFS 共享内的挂载点文件夹

无法打开 NFS 共享内的挂载点文件夹

我有一台树莓派。我已/home/pi/通过 NFS 共享文件夹,如下所示:

contents of /etc/exports 

/home/pi        *(rw,all_squash,insecure,async,no_subtree_check,anonuid=1000,anongid=1000)

从另一台运行 Debian/KDE 的机器上,我可以正确启动 Dolphin 并输入 nfs://192.168.178.35/home/pi/打开/home/pi文件夹并允许我创建和编辑文件。

然后我将一个外部硬盘连接到树莓派并像这样安装它:

contents of /etc/fstab
/dev/sda1       /home/pi/WDD    ext4    user,relatime,nofail,errors=remount-ro,nodev,nosuid     0       0

WDD但是,当我尝试从远程 Debian/KDE 计算机打开该文件夹时,它WDD甚至没有被识别为文件夹,我无法打开它。该WDD文件夹属于 pi:pi,我可以在 raspberry 中正常使用它。谢谢。

答案1

正常情况下,无法访问 NFS 共享上远程挂载的文件系统。如果您想要解除限制,请使用 NFS 共享的crossmnt远程导出文件中设置的选项导出 NFS 共享,然后重新导出共享并在本地重新挂载。

man exports包含以下部分:

  crossmnt
          This option is similar to nohide but it makes it possible for clients to access all filesystems mounted on a filesystem marked with  crossmnt.
          Thus when a child filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has a similar effect to setting "nohide" on B.

          With nohide the child filesystem needs to be explicitly exported.  With crossmnt it need not.  If a child of a crossmnt file is not explicitly
          exported, then it will be implicitly exported with the same export options as the parent, except for fsid=.  This makes it impossible  to  not
          export  a  child  of a crossmnt filesystem.  If some but not all subordinate filesystems of a parent are to be exported, then they must be ex‐
          plicitly exported and the parent should not have crossmnt set.

          The nocrossmnt option can explictly disable crossmnt if it was previously set.  This is rarely useful.

编辑:

您的exports参赛作品/主页/pi看起来应该是这样的:

/home/pi        *(rw,all_squash,insecure,async,no_subtree_check,anonuid=1000,anongid=1000,crossmnt)

exportfs -r然后在你的 Raspberry Pi 上做一个并mount <mount-point> -o remount在本地做一个,就可以了。

相关内容