Linux - fuser - umount device busy

有時候 USB DiskonKey 或是遠端分享目錄掛載( mount )後怎麼樣都無法移除掛載( umount ),就像是下面所出現的提示訊息一樣.

[root@benjr media]# umount /media/
unmount error 16 = Device or resource busy
Refer to the umount.cifs(8) manual page (man 8 umount.cifs)

這不能移除掛載的狀況有很多有可能是程式還在該目錄下做存取或是檔案已經被開啟的狀態中..等等的情況都有可能.此時我們可以透過 "Fuser" 指令來查出到底是什麼原因讓該目錄無法移除掛載. 

[root@benjr media]# fuser -m /media/
/media/:               849c

原來是 PID(Process ID) 849 這麼程式讓該目錄除法移除掛載.那後面的 c 是代表什麼呢!!


  c  current directory.
  e  executable being run.
  f  open file. f is omitted in default display mode.
  F  open file for writing. F  is  omitted  in  default display mode.
  r  root directory.
  m  mmap'ed file or shared library.

先查一下 PID 849 是在做什麼,之後你自己就可以決定是不是要用 kill 來移除這一程序.

[root@benjrmedia]# ps -auxw |grep 849
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root       849  0.0  0.0  66096  1584 pts/4    Ss   16:52   0:00 bash
root      2075  0.0  0.0  61188   752 pts/4    S+   23:54   0:00 grep 849

或是直接加參數 -k ,移除該程序.

[root@benjr media]# fuser -kvm /media/

 

http://benjr.tw/node/580

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值