umount移動硬盤遇到device is busy問題


#umount  /mnt/fourt
umount: /mnt/fourt: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
        

fuser 概述
fuser命令是用來顯示所有正在使用着指定的file, file system 或者 sockets的進程信息。
例:
#fuser -m -u /mnt/fourt
/mnt/fourt:          14917c(root) 14918c(root)
在例子中,使用了-m和-u選項,用來查找所有正在使用/mnt/fourt 的所有進程的PID,以及該進程的OWNER,如14917c(root),其中14917是進程PID,root是該進程的OWNER。
fuser會顯示正在使用指定的file,file system 或者 sockets的進程的PID。在默認的顯示模式下,每個文件名之后會跟隨一個字符,用來指示當前的訪問類型。
如下所示:
c
    current directory.
e
    executable being run.
f
    open file.
F
    open file for writing.
r
    root directory.
m
    mmap'ed file or shared library
    
    
查看進程使用的文件:    
# ls -al /proc/14917/fd/
total 0
dr-x------ 2 root  root    0 Jul 28 09:58 .
dr-xr-xr-x 7 root screen  0 Jul  8 12:44 ..
lr-x------ 1 root  root   64 Jul 28 09:58 0 -> /dev/null
l-wx------ 1 root  root   64 Jul 28 09:58 1 -> /dev/null
l-wx------ 1 root  root   64 Jul 28 09:58 2 -> /dev/null
lr-x------ 1 root  root   64 Jul 28 09:58 3 -> /var/run/screen/S-aimin/14917.pts-6.centos64
lrwx------ 1 root  root   64 Jul 28 09:58 5 -> /dev/ptmx
lr-x------ 1 root  root   64 Jul 28 09:58 6 -> /var/run/utmp

# ls -al /proc/14918/fd/
total 0
dr-x------ 2 root root  0 Jul 28 09:58 .


#ps --ppid 14917
#ps --ppid 14918

kill進程:
#kill -9 14917
#kill -9 14918

再次umount

#umount  /mnt/fourt

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM