我有 Ubuntu 和 CentOS 客户端 nfsv3 安装到 FreeBSD 盒子,在连接 nfs 客户端时重新启动。现在,客户端在尝试访问挂载点时会被拒绝。
在我尝试过的客户端上
# umount /nobackup/dat
umount.nfs: /nobackup/dat: device is busy
umount.nfs: /nobackup/dat: device is busy
# fuser /nobackup/dat
Cannot stat file /proc/1660/fd/473: Stale NFS file handle
Cannot stat file /proc/1660/fd/475: Stale NFS file handle
Cannot stat file /proc/1660/fd/476: Stale NFS file handle
Cannot stat file /proc/1660/fd/478: Stale NFS file handle
Cannot stat file /proc/1660/fd/479: Stale NFS file handle
Cannot stat file /proc/14509/fd/1: Stale NFS file handle
Cannot stat file /proc/14674/fd/1: Stale NFS file handle
Cannot stat file /proc/14871/fd/1: Stale NFS file handle
Cannot stat file /proc/27872/fd/436: Stale NFS file handle
Cannot stat file /proc/27872/fd/444: No such file or directory
# umount -f /nobackup/dat
umount2: Device or resource busy
umount.nfs: /nobackup/dat: device is busy
umount2: Device or resource busy
umount.nfs: /nobackup/dat: device is busy
更新
现在我已经杀死了所有进程并成功卸载/nobackup/dat
,但由于某种原因我仍然收到权限被拒绝错误。
# fuser -m /nobackup/dat 2>&1 | awk -F'/' '{print $3}' | xargs -n 1 kill
# fuser -m /nobackup/dat
# umount -l /nobackup/dat
# ll /nobackup/dat
ls: cannot open directory /nobackup/dat: Permission denied
# mount /nobackup/dat
mount.nfs: access denied by server while mounting (null)
问题
有什么建议如何调试吗?
问题是客户端没有意识到 nfs 服务器消失了,所以他们仍在尝试访问上一次挂载文件系统时创建的文件句柄。
通常,重新启动客户端是使其重新挂载文件系统的可靠方法。但是,如果您不想这样做,请先终止所有尝试使用 NFS 文件系统的进程。之后,您可以尝试“延迟卸载”
您也可以尝试重新挂载文件系统,使用
否则,旧文件句柄将在某个时候超时,但我不知道需要多长时间。
成功摆脱陈旧的文件句柄后,重新挂载文件系统: