linux无法umount目录,Linux umount卸载无响应的NFS文件系统

当NFS Client无法访问NFS Server的时候,在Client上df -h操作就会卡住.这个时候就需要将挂载的NFS卸载掉,在不知道挂载点的情况下,可以使用nfsstat -m命令来查看.

nfsstat未安装的话可以配置好yum源直接yum安装:yum install -y nfsstat

[root@test ~]# nfsstat -m

/home/app/test from 1.2.3.4:/home/app

Flags: rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=1.2.3.4,mountvers=3,mountport=4001,mountproto=udp,local_lock=none,addr=1.2.3.4

结果发现umount -f和fuser -k都卸载不掉,报错:umount2: Device or resource busy.

最后查询得知,可以用umount -l直接卸载:umount -l /home/app/test

[root@test ~]# umount --help

Usage:

umount [-hV]

umount -a [options]

umount [options] |

Options:

-a, --all unmount all filesystems

-A, --all-targets unmount all mountpoins for the given device

in the current namespace

-c, --no-canonicalize don't canonicalize paths

-d, --detach-loop if mounted loop device, also free this loop device

--fake dry run; skip the umount(2) syscall

-f, --force force unmount (in case of an unreachable NFS system)

-i, --internal-only don't call the umount. helpers

-n, --no-mtab don't write to /etc/mtab

-l, --lazy detach the filesystem now, and cleanup all later

-O, --test-opts limit the set of filesystems (use with -a)

-R, --recursive recursively unmount a target with all its children

-r, --read-only In case unmounting fails, try to remount read-only

-t, --types limit the set of filesystem types

-v, --verbose say what is being done

-h, --help display this help and exit

-V, --version output version information and exit

For more details see umount(8).

选项–l并不是马上umount,而是在该目录空闲后再umount.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值