zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    luogu P3834 【模板】可持久化线段树 1(主席树) 查询区间 [l, r] 内的第 k 小/大值
    覆盖的面积 HDU
    Picture POJ
    Atlantis HDU
    Transformation HDU
    Tunnel Warfare HDU
    Agri-Net POJ
    Conscription POJ
    Brush (IV) LightOJ
    Throwing Dice LightOJ
  • 原文地址:https://www.cnblogs.com/emanlee/p/3872518.html
Copyright © 2011-2022 走看看