問題描述:
因為掛載錯了,想取消掛載,但是umount報告如下錯誤:
[root@zabbix /]# umount /dev/sdc1 umount: /data1: target is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
根據描述應該其他進程對掛載的目錄有占用的情況
解決方案:
關閉占用的進程,但是在使用fuser命令的時候顯示沒有這個命令
[root@zabbix /]# fuser -m /dev/sdc1 -bash: fuser: command not found
然后需要安裝一下:
[root@zabbix /]# yum install -y psmisc
再去使用fuser命令查看進程:
[root@zabbix /]# fuser -m /dev/sdc1 /dev/sdc1: 10246c
[root@zabbix /]# ps aux | grep 10246 root 10246 0.0 0.0 116460 3212 pts/0 Ss+ Oct19 0:00 -bash
使用kill命令關閉進程:
[root@zabbix /]# kill -9 10246
關閉進程以后再umount就成功了:
[root@zabbix /]# umount /dev/sdc1
最后可以使用df -h查看掛載情況,會發現已經取消掛載成功!