ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux使用fuser命令找出访问文件系统的进程

Linux使用fuser命令找出访问文件系统的进程

Linux操作系统 作者:minxuan2013 时间:2014-12-30 13:40:23 0 删除 编辑

fuser用于标识访问文件或socket的进程信息。下面以经常会遇到的不能卸载光驱为例,讨论fuser的用法:


1).卸载光驱文件系统:
[root@vserver01 ~]# umount /mnt
umount: /mnt: device is busy
umount: /mnt: device is busy

2).找出依然在访问该文件系统的进程号:
[root@vserver01 ~]# fuser -c /mnt
/mnt:                 2563c
[root@vserver01 ~]# ps -ef | grep 2563
root      2563  2499  0 15:19 tty1     00:00:00 -bash
root      5462  5383  0 16:11 pts/0    00:00:00 grep 2563

3).kill进程:
[root@vserver01 ~]# kill -9 2563
[root@vserver01 ~]# ps -ef | grep 2563
root      5488  5383  0 16:11 pts/0    00:00:00 grep 2563

4).成功卸载光驱文件系统:
[root@vserver01 ~]# umount /mnt
[root@vserver01 ~]# 

有关fuser命令的详情参考文章:http://www.ha97.com/1030.html

--end--

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29615408/viewspace-1384899/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-12-30

  • 博文量
    112
  • 访问量
    95869