umount 卸載失敗

centos7執(zhí)行umount提示:device is busy或者target is busy

問題描述:

系統(tǒng)盤sda2掛載到/mnt/disk1 目錄下 想取消

1.[root@localhost ~]# lsblk -l? ? #查看掛載

2.[root@localhost ~]#umount /mnt/disk1? ? #返回報錯

? 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)前哪個程序在使用磁盤上的某個文件、掛載點、或者網(wǎng)絡(luò)端口,并給出程序進程的詳細(xì)信息.

3.[root@localhost ~]# fuser -mv -k /mnt/disk1/? #運行后可能需要重啟服務(wù)器

使用fuser? -mv -k? /mnt 先殺死使用該目錄的所有進程,然后在執(zhí)行卸載操作

-m? 后跟一個目錄、文件或者設(shè)備名,列出使用該文件的進程PID

-v 顯示詳細(xì)信息

-k 殺死使用指定文件的所有進程

4.[root@localhost ~]# umount /mnt/disk1? ? #執(zhí)行umount 成功

5.[root@localhost ~]# lsblk -l? ? #再次查看掛載

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容