mount nfs卡住的问题

现象

某个台Linux server 运行,df -h 命令会卡住,查看df进程的stack会看到NFS相关的信息。

分析

运行 mount 命令查看,确实有nfs相关的信息(如下)

192.168.1.10:/mnt/test on /mnt/test type nfs4 (rw,relatime,

基本就确定了NFS的问题,可能是NFS sever端有异常了导致客户端mount有问题。

解决方法

解决方法就是卸载之前挂载的NFS文件系统即可。

但是直接 umount /mnt/test 命令也会卡住,卸载失败;所以要尝试使用 -f 参数 umount -f /mnt/test 命令强制卸载,如果这个还遇到’device is busy’ 的错误提示,可以多试几次;当然更好的方法是再加上 -l 参数 umount -f -l /mnt/test 进行lazy umount,这个一般都可以了。

umount -f -l /mnt/test

-f 强制umount,即使NFS服务器不可达。
 Force unmount (in case of an unreachable NFS system).

-l 懒umount,文件系统不繁忙的时候移除所有引用
Lazy unmount.  Detach the filesystem from the filesystem hierarchy  now,  and  cleanup  all  references  to  the
              filesystem as soon as it is not busy anymore.

master

Stay hungry, stay foolish.

发表回复

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

*