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

转载 linux umount 时出现device is busy 的处理方法--fuser的更多相关文章

  1. [Linux] umount目录提示device is busy的解决方法

    使用sshfs等方式挂载的目录出现问题时,使用umount卸载经常提示device is busy,如果仔细阅读错误提示就可以找到命令lsof和fuser命令. 其实原因就是有进程占用当前目录,导致不 ...

  2. linux中U盘umonut时出现“Device is busy”的解决方法

    问题: #umount /dev/sda1 umount: /mnt/usb: device is busy 查找占用目录进程: #lsof |grep /mnt/usb bash 1971 root ...

  3. Linux 环境下umount, 报 device is busy 的问题分析与解决方法

    在Linux环境中,有时候需要挂载外部目录或硬盘等,但当想umount时,却提示类似“umount:/home/oracle-server/backup:device is busy”这种提示. 出现 ...

  4. 解决umount.nfs: /data: device is busy 问题

    有时候我们需要umount某个挂载目录时会遇到如下问题: [root@localhost /]# umount /data/ umount.nfs: /data: device is busy 通过这 ...

  5. umount移动硬盘遇到device is busy问题

    #umount  /mnt/fourtumount: /mnt/fourt: device is busy.        (In some cases useful info about proce ...

  6. 执行umount 的时候却提示:device is busy 的处理方法

    [root@web2-server yum.repos.d]# umount /mnt/cdrom/ umount: /mnt/cdrom: device is busy. (In some case ...

  7. umount device is busy 的处理方法

    [root@web2-server yum.repos.d]# umount /mnt/cdrom/ umount: /mnt/cdrom: device is busy. (In some case ...

  8. Linux umount设备时出现device is busy解决方法

    在Linux中,有时使用umount命令去卸载LV或文件时,可能出现umount: xxx: device is busy的情况,如下案例所示 [root@DB-Server u06]# vgdisp ...

  9. centos7执行umount提示:device is busy或者target is busy解决方法

    问题描述: 因为挂载错了,想取消挂载,但是umount报告如下错误: [root@zabbix /]# umount /dev/sdc1 umount: /data1: target is busy. ...

随机推荐

  1. Windows命令行参数(不断更新)

    这里先讲一下系统变量: 注意:一旦将路径加入到环境变量Path中,那么运行它下面的程序的时候就不用非得指定到目标路径中,直接键入命令就行了. 1.type命令:打开并读取文件里面的内容. C:\Use ...

  2. #include 和 #import 的区别, @class 的含义

    #import 和 #include  会包含这个类的所有信息,包括实体变量和方法 而#include比起 #import的好处不会引起重复包含 @class是用来做类引用的 @class就是告诉编译 ...

  3. colorbox在android上由于高度太高无法scroll问题

    首先看问题截图: 我们可以看到弹出的colorbox页面的高度已经到了下面,你根本看不到"mistake cross"<=>"X". 我测试了iph ...

  4. Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告

    BComp.exe /silent /closescript /solo @E:\compareTest\BCbatch.txt text-report layout:side-by-side opt ...

  5. AndroidPn推送测试

    服务器搭建好了之后,往客户端推送.按照里面自带的一个client,可以分别在模拟器和真机上分别测试,不过由于这个框架真的不是很完善,会遇到各种问题. (1) 其中还遇到了一个安卓模拟器的问题,启动模拟 ...

  6. Linux - 修改文件编码

    enca -L zh_CN -x UTF- file

  7. C#——调用C++的DLL 数据类型转换

    /C++中的DLL函数原型为        //extern "C" __declspec(dllexport) bool 方法名一(const char* 变量名1, unsig ...

  8. 【转】Lucene工作原理——反向索引

    原文链接:  http://my.oschina.net/wangfree/blog/77045 倒排索引 倒排索引(反向索引) 倒排索引源于实际应用中需要根据属性的值来查找记录.这种索引表中的每一项 ...

  9. Android 导入 aar 库文件

    1. 在需要导入 aar 的 module 目录下创建一个名叫 "aars" 的目录,并把 aar 文件复制到这里. 2. 在项目的 build.gradle 文件里添加 allp ...

  10. Redux其实很简单(原理篇)

    在这一篇文章中,笔者将带大家编写一个完整的Redux,深度剖析Redux的方方面面,读完本篇文章后,大家对Redux会有一个深刻的认识. 核心API 这套代码是笔者阅读完Redux源码,理解其设计思路 ...