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. day01(静态、代码块、类变量和实类变量辨析 )

    静态: 关键字:static          概述: 使用static关键字修饰的成员方法.成员变量称为静态成员方法.静态成员变量.    优缺点:   优点:使用时不用创建对象,节约了空间.使得代 ...

  2. noip第8课作业

    1.     计算书费 [问题描述]下面是一个图书的单价表: 计算概论 28.9 元/本 数据结构与算法 32.7 元/本 数字逻辑 45.6元/本 C++程序设计教程 78 元/本 人工智能 35  ...

  3. Lucene 中自定义排序的实现

    使用Lucene来搜索内容,搜索结果的显示顺序当然是比较重要的.Lucene中Build-in的几个排序定义在大多数情况下是不适合我们使用的.要适合自己的应用程序的场景,就只能自定义排序功能,本节我们 ...

  4. Android之ubuntu源码开发环境搭建笔记

    昨天,把电脑主机全换了,因此之前的工作环境得重新搭建,我是既开心又纠结,开心的是可以用高配置的电脑,纠结的是搭环境比较麻烦,稍有不慎,就会导致源代码编译不过,前功尽弃.为了减少工作量,以及避免不必要掉 ...

  5. iOS应用开发最佳实践

    <iOS应用开发最佳实践> 基本信息 作者: 王浩    出版社:电子工业出版社 ISBN:9787121207679 上架时间:2013-7-22 出版日期:2013 年8月 开本:16 ...

  6. Android RelativeLayout属性介绍

    在Android开发当中,虽然有五大布局,但我推荐使用的是相对布局,Google也是推荐使用相对布局,所有对RelativeLayout布局,常用的属性做一个整理: android:layout_ma ...

  7. 二、安装并配置Kubernetes Master节点

    1. 安装配置Master节点上的Kubernetes服务 1.1 安装Master节点上的Kubernetes服务 yum -y install kubernetes 1.2 修改kube-apis ...

  8. 【NumberValidators】类库介绍

    NumberValidators是一个用于验证中国大陆证件.号码是否符合国家标准的类库,因为该类库在昨日已经正式发布1.0.0版本至nuget,所以在此介绍下该类库的具体功能. NumberValid ...

  9. C# 委托和接口

    能用委托解决的事情,接口也都可以解决.如下所示: public static void Main() { , , , }; Util.TransformAll(values, new Squarer( ...

  10. 在kolla中配置cinder ceph多后端

    原文链接:在kolla中配置cinder ceph多后端