#正常尝试卸载,提示设备忙
[root@localhost /]# umount /mnt/
umount: /mnt: device is busy
#使用正常的强制卸载,仍然是设备忙
[root@localhost /]# umount -f /mnt/
umount2: Device or resource busy
umount: /mnt: device is busy
.
#解决方法
#使用fuser命令,先确认有那些进程需要杀掉
[root@localhost /]# fuser -cu /mnt
/mnt: 15060c(root)
#其次向进程发出SIGKILL信号
[root@localhost /]# fuser -ck /mnt
/mnt: 15060c
#确认卸载成功
[root@localhost /]# umount /mnt/
umount: /mnt: not mounted
.
#顽固挂载点解决办法
现象就是连 fuser -ck /mnt 也卡住
1、先中止掉 fuser -ck /mnt
2、杀掉所所D状态的进程(进程状态可参考这里)
ps -eo stat,pid --no-headers | awk '$1 ~ /^D/ {print $2}' | xargs -r kill -9
3、将挂载点/mnt从命名空间取消,即让新访问这个挂载点的进程不要再等待了
umount -l /mnt
.
.
.