天天看點

lsof/fuser解除安裝挂載檔案

Linux如何解除安裝挂載檔案

在我們進行遠端檔案操作的時候,我們經常會出現檔案服務出現解除安裝掉哦情況。例如

umount /mnt/net1

umount: /mnt/net1: device is busy.

        (In some cases useful info about processes that use

         the device is found by lsof(8) or fuser(1))

這種問題解決方案:

一、查找使用這個檔案的程序和指令,具體的操作代碼

[root@localhost ~]# lsof |grep /mnt/net1

lsof: WARNING: can't stat() cifs file system /mnt/net1

      Output information may be incomplete.

bash      18841      root  cwd   unknown                                            /mnt/net1/TDDOWNLOAD/軟體 (stat: No such device)

二、然後執行ps指令可以查找執行此程序的指令

[root@localhost ~]# ps -ef|grep 18841

root     18841 18839  0 Nov29 pts/2    00:00:00 /bin/bash -l

root     29496 25604  0 16:26 pts/0    00:00:00 grep 18841

三、強行結束無關程序

[root@localhost ~]# kill -9 18841

四、然後解除安裝相關挂載

[root@localhost ~]# umount /mnt/net1

五、然後可以在功過mount指令進行檢視。

繼續閱讀