文档章节

xxxx device is busy

zhangjianyf
 zhangjianyf
发布于 2016/07/07 10:44
字数 972
阅读 26
收藏 0

当使用umount  /u01/mount/会出现

umount2: Device or resource busy
umount: /u01/mount: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

后来加了-f参数

umount -f /u01/mount/

还是报上面同样的错误,且已退出了它所在的目录

这时fuser命令就有派上用场了:

fuser -km /u01/mount/
/u01/mount:          29850c

fuser 命令显示访问某个文件的进程的PID. 。-k 是kill 访问这个文件的进程。 没有进程访问,就可以成功umount了。

不过上面的29850c

c表示的是当前路径。还有其他的字符

c 当前路径(current directory.)我的理解是表示这个资源的占用是以文件目录方式,也就是进进入了需要释放的资源的路径,这是最常用的资源占用方式。
e 正在运行可执行文件(executable being run.),比如运行了光盘上的某个程序
f 打开文件( open file),缺省模式下f忽略。所以上面的例子中,虽然是开打了光盘上的Autorun.inf文件,但是给出的标识是c,而不是f。
r root目录(root directory).不太清楚?
m mmap文件或者共享库( mmap’ed file or shared library).这应该是说某个进程使用了你要释放的资源的某个共享文件

具体的fuser可以使用man fuser

下面是它的参数用法

FUSER(1)       User Commands                        FUSER(1)

NAME

fuser - identify processes using files or sockets

SYNOPSIS

fuser [-a|-s|-c] [-4|-6] [-n  space ] [-k [-i] [-signal ] ] [-muvf] name

fuser -l

fuser -V

DESCRIPTION

fuser displays the PIDs of processes using the specified files or file systems.  In the default display mode, each file name is followed by a letter denoting the  type

of access:

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.

fuser  returns a non-zero return code if none of the specified files is accessed or in case of a fatal error. If at least one access  has  been  found,  fuser  returns zero.

In  order  to  look  up processes using TCP and UDP sockets, the corresponding name space has to be selected with the -n option. By default fuser  will  look  in  both IPv6  and IPv4 sockets. To change the default, behavior, use the -4 and -6 options. The socket(s) can be specified by  the  local  and  remote  port,  and  the  remote address.  All  fields  are  optional, but commas in front of missing fields must be present:

[lcl_port][,[rmt_host][,[rmt_port]]]

Either symbolic or numeric values can be used for IP addresses and port numbers.

fuser outputs only the PIDs to stdout, everything else is sent to stderr.

OPTIONS

-a     Show all files specified on the command line. By default,  only  files  that are accessed by at least one process are shown.

-c     Same as -m option, used for POSIX compatibility.

-f     Silently ignored, used for POSIX compatibility.

-k     Kill  processes  accessing the file. Unless changed with -signal, SIGKILL is sent. An fuser process never kills itself, but may  kill  other  fuser  processes.  The  effective user ID of the process executing fuser is set to its real user ID before attempting to kill.

-i     Ask the user for confirmation before  killing  a  process.  This  option  is silently ignored if -k is not present too.

-l     List all known signal names.

-m    name  specifies  a  file  on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed.  If adirectory  file  is  specified, it is automatically changed to name/. to use any file system that might be mounted on that directory.

-n space Select a different name  space.  The  name  spaces  file  (file  names,  the default),  udp  (local  UDP ports), and tcp (local TCP ports) are supported. For ports, either the port number or the symbolic name can be specified.  If  there  is no ambiguity, the shortcut notation name/Ispace (e.g. 80/tcp ) can be used.

-s     Silent operation. -u and -v are ignored in this mode.  -a must not  be  used with -s.

-signal Use  the specified signal instead of SIGKILL when killing processes. Signals can be specified either by name (e.g. -HUP) or by  number  (e.g.  -1).  This option is silently ignored if the -k option is not used.

-u     Append the user name of the process owner to each PID.

-v     Verbose  mode.  Processes are shown in a ps-like style. The fields PID, USER and COMMAND are similar to ps. ACCESS shows how  the  process  accesses  the file.  If  the access is by the kernel (e.g. in the case of a mount point, awap file, etc.), kernel is shown instead of the PID.

-V     Display version information.

-4     Search only for IPv4 sockets. This option must  not  be  used  with  the  -6 option and only has an effect with the tcp and udp namespaces.

© 著作权归作者所有

zhangjianyf
粉丝 1
博文 22
码字总数 20596
作品 0
数据库管理员
私信 提问
【解决方式】Docker remove in process

问题:docker rm 出现Remove In Process,可能是有其它程序占用它 解决方式: 找出占用它的程序, docker rm 时,可能会提示/var/lib/docker/containers/overlay2/ device busy之类的字眼; ...

沈猪猪
2018/08/01
0
0
linux下强行umount卸载设备

卸载NFS,结果出现无法卸载的情况 [root@localhost /]# umount /mnt/ umount: /mnt: device is busy umount: /mnt: device is busy 使用umount -f,问题依旧 [root@localhost /]# umount -f ......

Mr_sheng
2018/07/17
0
0
Linux存储挂载后,无法正常卸载的解决方法

明明设备没有任何人在操作,却无法使用umount正常卸载 umount /dev/sdd1 umount: /TomcatLog: device is busy. (In some cases useful info about processes that use the device is found b......

LionelShen
2016/02/18
472
1
Linux访问光驱内容(加载光驱\访问cdrom\加载cdrom\创建加载点)

1、建立一个目录(即新建加载点),用于挂在设备(此处在根目录下面建立TMPDVD目录) linux-djs:/ # cd / linux-djs:/ # md tmpDVD 2、将cdrom设备加载到tmpDVD目录 linux-djs:/dev # mount...

Oscarfff
2016/03/06
29
0
怎么样制作DVD/USBl来安装redhat linux

Using the ISO to Create a Bootable DVD To create (burn) a CD or DVD, write the ISO to the disc on command line using the cdrecord utility. Example: Raw [root@host ~]# cdrecord -......

chenzudao
2017/09/01
0
0

没有更多内容

加载失败,请刷新页面

加载更多

JWT学习总结

官方 https://jwt.io 英文原版 https://www.ietf.org/rfc/rfc7519.txt 或 https://tools.ietf.org/html/rfc7519 中文翻译 https://www.jianshu.com/p/10f5161dd9df 1. 概述 JSON Web Token(......

冷基
今天
4
0
AOP的学习(1)

AOP 理解AOP编程思想(面向方法、面向切面) spring AOP的概念 方面 -- 功能 目标 -- 原有方法 通知 -- 对原有方法增强的方法 连接点 -- 可以用来连接通知的地方(方法) 切入点 -- 将用来插入...

太猪-YJ
今天
4
0
一张图看懂亮度、明度、光度、光亮度、明亮度

亮度、明度、光亮度,Luminance和Brightness、lightness其实都是一个意思,只是起名字太难了。 提出一个颜色模型后,由于明度的取值与别人的不同,为了表示区别所以就另想一个词而已。 因此在...

linsk1998
昨天
11
0
Python应用:python链表示例

前言 python链表应用源码示例,需要用到python os模块方法、函数和类的应用。 首先,先简单的来了解下什么是链表?链表是一种物理存储单元上非连续、非顺序的存储结构,数据元素的逻辑顺序是...

python小白1
昨天
5
0
Source Insight加载源码

Source Insight是一个图形化的源代码查看工具(当然也可以作为编译工具)。如果一个项目的源代码较多,此工具可以很方便地查找到源代码自建的依赖关系。 1.创建工程 下图为Snort源代码的文件...

天王盖地虎626
昨天
6
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部