zoukankan      html  css  js  c++  java
  • 转载 linux umount 时出现device is busy 的处理方法--fuser

    http://www.cnblogs.com/spicy/p/6894333.html (原文链接)

    当任何目录有 mount, 然后有程序使用/挂在那个目录上的话, 就没有办法 umount 掉, 於 umount 时会出现 Device is busy 的讯息.

    要怎麼找出是哪个程序挂在那个目录上? 然后去把那个程式砍掉呢?

    使用 fuser 的指令

    那要怎麼找出是哪个程式挂在那个目录上?可以使用 fuser - identify processes using files or sockets

    假设现在 mount 起来的目录是 /media/share

        * 查询: fuser -m /media/share
        * 显示: /media/share: 25023c

    就代表是 process 25023(pid) 有使用到此目录, 后面 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.

    要把这个资源释放的话, 可以有下述做法:

        * kill -9 25023 # ps aux | grep 25023 应该就会看到它
        * fuser -m -v -i -k /media/share # 会问你是不是要把 25023 这个 kill 掉, 选 y 就会 kill 掉

              提示信息如下:
              USER      PID   ACCESS COMMAND
              /meida/share: root      25023 ..c..  bash
              Kill process 25023 ? (y/N) y

  • 相关阅读:
    MVC框架简介
    模型-视图-控制器模式
    高德地图基本开发
    质量属性的六个常见属性场景分析
    架构漫谈读后感
    第十周
    第九周总结
    第八周总结
    springboot基于mybatis的pegehelper分页插件
    webmagic之爬取数据存储为TXT
  • 原文地址:https://www.cnblogs.com/spicy/p/6907084.html
Copyright © 2011-2022 走看看