在我們進行遠程文件操作的時候,我們經常會出現文件服務出現卸載掉哦情況。例如
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命令進行查看。
擴展學習
掌握mount高級應用
掌握ps高級應用
掌握lsof/fuser高級應用