如何解决 “mount.nfs: Stale file handle”错误

Kerneltalks 的头像

·

·

·

39,353 次阅读

了解如何解决 Linux 平台上的 mount.nfs: Stale file handle 错误。这个 NFS 错误可以在客户端或者服务端解决。

当你在你的环境中使用网络文件系统时,你一定不时看到 mount.nfs:Stale file handle 错误。此错误表示 NFS 共享无法挂载,因为自上次配置后有些东西已经更改。

无论是你重启 NFS 服务器或某些 NFS 进程未在客户端或服务器上运行,或者共享未在服务器上正确输出,这些都可能是导致这个错误的原因。此外,当这个错误发生在先前挂载的 NFS 共享上时,它会令人不快。因为这意味着配置部分是正确的,因为是以前挂载的。在这种情况下,可以尝试下面的命令:

确保 NFS 服务在客户端和服务器上运行良好。

#  service nfs status
rpc.svcgssd is stopped
rpc.mountd (pid 11993) is running...
nfsd (pid 12009 12008 12007 12006 12005 12004 12003 12002) is running...
rpc.rquotad (pid 11988) is running...

如果 NFS 共享目前挂载在客户端上,则强制卸载它并尝试在 NFS 客户端上重新挂载它。通过 df 命令检查它是否正确挂载,并更改其中的目录。


# umount -f /mydata_nfs

# mount -t nfs server:/nfs_share /mydata_nfs

#df -k
 output clipped 

via: <https://kerneltalks.com/troubleshooting/resolve-mount-nfs-stale-file-handle-error/>

作者:[KernelTalks](https://kerneltalks.com) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注