Linux如何卸载挂载文件

来源:互联网 发布:网络连接错误代码720 编辑:程序博客网 时间:2024/05/17 23:27

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

umount /u03
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))

这种问题解决方案:

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

umount: /u03: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
[root@storedb ~]# lsof |grep /u03
bash       2413      root  cwd       DIR               8,17        4096    3301377 /u03/stage2

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

[root@storedb ~]# ps -ef |grep 2413
root      2413  2329  0 Aug02 tty1     00:00:00 -bash
root     28657 28622  0 17:17 pts/2    00:00:00 grep 2413

三、强行结束无关进程

[root@localhost ~]# kill -9 2413

四、然后卸载相关挂载

[root@localhost ~]# umount /u03

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

0 0