centos7執(zhí)行umount提示:device is busy或者target is busy
問(wèn)題描述:
系統(tǒng)盤(pán)sda2掛載到/mnt/disk1 目錄下 想取消
1.[root@localhost ~]# lsblk -l? ? #查看掛載
2.[root@localhost ~]#umount /mnt/disk1? ? #返回報(bào)錯(cuò)
? umount: /mnt: target is busy.
? ? ? ? (In some cases useful info about processes that use
? ? ? ? the device is found by lsof(8) or fuser(1))
解決方案:
1.[root@localhost ~]#fuser -m /mnt/disk1? ? #根據(jù)提示使用fuser命令
? -bash:fuser: command not found
2.[root@localhost ~]#yum install-y psmisc? #安裝fuser
關(guān)于fuser的介紹:
fuser 可以顯示出當(dāng)前哪個(gè)程序在使用磁盤(pán)上的某個(gè)文件濒翻、掛載點(diǎn)、或者網(wǎng)絡(luò)端口啦膜,并給出程序進(jìn)程的詳細(xì)信息.
3.[root@localhost ~]# fuser -mv -k /mnt/disk1/? #運(yùn)行后可能需要重啟服務(wù)器
使用fuser? -mv -k? /mnt 先殺死使用該目錄的所有進(jìn)程有送,然后在執(zhí)行卸載操作
-m? 后跟一個(gè)目錄、文件或者設(shè)備名僧家,列出使用該文件的進(jìn)程PID
-v 顯示詳細(xì)信息
-k 殺死使用指定文件的所有進(jìn)程
4.[root@localhost ~]# umount /mnt/disk1? ? #執(zhí)行umount 成功
5.[root@localhost ~]# lsblk -l? ? #再次查看掛載