加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

lsof/fuser卸载挂载文件

发布时间:2020-12-14 02:02:06 所属栏目:Linux 来源:网络整理
导读:? ? Linux如何卸载挂载文件 2011年12月19日 16:29:55?davil_dev? 阅读数:22933 ? 在我们进行远程文件操作的时候,我们经常会出现文件服务出现卸载掉哦情况。例如 umount /mnt/net1 umount: /mnt/net1: device is busy. ??????? (In some cases useful info

?

?

Linux如何卸载挂载文件

在我们进行远程文件操作的时候,我们经常会出现文件服务出现卸载掉哦情况。例如

umount /mnt/net1
umount: /mnt/net1: device is busy.
??????? (In some cases useful info about processes that use
???????? the device is found by?lsof(8) or fuser(1))

这种问题解决方案:

一、查找使用这个文件的进程和命令,具体的操作代码

[[email?protected] ~]# lsof |grep /mnt/net1
lsof: WARNING: can‘t stat() cifs file system /mnt/net1
????? Output information may be incomplete.
bash????? 18841????? root? cwd?? unknown??????????????????????????????????????????? /mnt/net1/TDDOWNLOAD/软件 (stat: No such device)

二、然后执行ps命令可以查找执行此进程的命令

[[email?protected] ~]# ps -ef|grep 18841
root???? 18841 18839? 0 Nov29 pts/2??? 00:00:00 /bin/bash -l
root???? 29496 25604? 0 16:26 pts/0??? 00:00:00 grep 18841

三、强行结束无关进程

[[email?protected] ~]# kill -9 18841

四、然后卸载相关挂载

[[email?protected] ~]# umount /mnt/net1

五、然后可以在功过mount命令进行查看。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读