挂载 Linux NFS。rpc.statd 未运行

T. *_*ter 8 linux nfs

我有 Ubuntu 12.04 作为 NFS 服务器。客户端是Linux。我的 /etc/exports文件有 1 行,

/folderToExport *(rw,async,no_subtree_check)  
Run Code Online (Sandbox Code Playgroud)

/etc/init.d/nfs-kernel-server status显示 NFS 共享按预期工作。问题是,每当我尝试从另一台 Linux 主机挂载 NFS 共享时,stdout 都会说

mount.nfs: rpc.statd is not running but is required for remote locking
mount.nfs: use '-o nolock'...or start statd
Run Code Online (Sandbox Code Playgroud)

ps -ef |grep statd显示rpc.statd已经在运行,那么为什么他们说“启动 statd”?

包括他们的-o nolock建议允许挂载 NFS 发生,但随后挂载的 NFS 变为只读。该/etc/exports文件要求rw.

你如何开始statd?NFS 客户端或服务器是否缺少某些配置?


这对我有用。为 中的每个共享文件夹做一个声明/etc/exports,例如

/folderToExport *(rw,async,no_subtree_check) 
Run Code Online (Sandbox Code Playgroud)

statd 可以通过

service statd stop 其次是

service statd start. 然后ps -ef |grep statd显示

statd 1994 1 0 15:23 ? 00:00:00 rpc.statd -L

一旦你确认它statd正在运行,接下来mount从 Linux 客户端运行,

mount 192.168.1.3:/folderToExport /mountFolder

应该不会再有消息 rpc.statd is not running ... start statd

最后,确保 NFS 服务器上的rw权限允许权限。(/etc/exports仅修改文件是不够的)

chmod 0777 /folderToExport -R

小智 6

我在这里找到了一个适用于 Raspbian 的答案。

启用 rpcbind 和 nfs 服务。

sudo update-rc.d rpcbind enable

sudo update-rc.d nfs-common enable

重启rpcbind服务

sudo service rpcbind restart


Ant*_*hon 4

statd是套餐的一部分nfs-common。您可能会发现自己可以为locate statd您带来其他好处/etc/init.d/statd

您可以statd从以下开始:

service statd start
Run Code Online (Sandbox Code Playgroud)

但它通常应该在系统启动时启动,但也许还有其他问题。您应该检查日志文件:grep statd /var/log/*看看是否有无法启动的原因。

/etc/exports看起来不错。我用:

/data0    *(rw,no_root_squash,no_subtree_check)
Run Code Online (Sandbox Code Playgroud)

在我的服务器上并且:

192.168.0.2:/data0 /data0   nfs  defaults,noauto,user 0 0
Run Code Online (Sandbox Code Playgroud)

/etc/fstab我的客户上。

  • 我刚刚又检查了一遍,它可以在 2 台 Ubuntu 计算机上运行,​​但即使安装了 nfs-common,它也不能在 raspbian 上运行。 (2认同)