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. Matlab 中以分数显示结果

    转http://www.blogbus.com/shijuanfeng-logs/234881647.html Matlab,计算得到的结果一般是小数形式. 但为了更精确表示,我们有时候需要用到分数形 ...

  2. 极小极大搜索方法、负值最大算法和Alpha-Beta搜索方法

    1. 极小极大搜索方法    一般应用在博弈搜索中,比如:围棋,五子棋,象棋等.结果有三种可能:胜利.失败和平局.暴力搜索,如果想通过暴力搜索,把最终的结果得到的话,搜索树的深度太大了,机器不能满足, ...

  3. VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h

    VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h 编译提示:fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加“# ...

  4. hdu 5011 Nim+拿完分堆

    http://acm.hdu.edu.cn/showproblem.php?pid=5011 有N堆珠子,两个人轮流拿,最少拿一个,可以全拿,每次只能从一个堆里拿,不能从多堆同时拿:拿完之后该人还有一 ...

  5. CUDA开发 - CUDA 版本

    "CUDA runtime is insufficient with CUDA driver"CUDA 9.2: 396.xx CUDA 9.1: 387.xx CUDA 9.0: ...

  6. DBCC--CHECKDB--结果收集

    --由宋沄剑提供 CREATE TABLE [dbo].[dbcc_history]( [Error] [int] NULL, [Level] [int] NULL, [State] [int] NU ...

  7. MySQL远程连接失败,MySQL远程连接出现Using password:YES错误的解决办法

    相信很多实用MYSQL的朋友都遇到过这种问题,就是MySQL使用localhost能够连接成功,但是使用IP连接却出现Using password:YES或者其它的连接错误.今天就把解决方法给大家说一 ...

  8. Python 爬虫实战—盘搜搜

    近期公司给了个任务:根据关键搜索百度网盘共享文件并下载. 琢磨了几天写下了一段简单的demo代码,后期优化没有处理. 主要的思路:(1)根据关键字爬取盘搜搜的相关信息 (2)解析并获取盘搜搜跳转到百度 ...

  9. WorkSpace

    --往GridControl中添加绑定数据 // 房间费用 DataTable dtRoomInfo = new DataTable(); dtRoomInfo.Columns.Add("v ...

  10. Android-------------fragment的学习

    一.fragment的静态使用 1.使用步骤:    a.继承fragment   重写onCreatevVew()的回调方法 b.设置Fragment的布局 c.在Activity中声明Fragme ...