Linux下卸载被进程占用的分区

有的时候在卸载目录时会看到类似下面的错误提示。

[root@localhost ~]# umount /mnt
umount: /mnt: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

这段信息是告诉你,设备正在被使用,无法卸载。此时,想卸载掉这块分区唯一的方法就是杀死占用他的进程。

先找出是谁在占用这块分区,可以看到这里占用他的是进程号为1341的进程,后面的c代表的是进程的权限,不予理会。

[root@localhost ~]# fuser /mnt
/mnt: 1341c

使用kill -9杀死该进程后即可成功卸载磁盘

[root@localhost ~]# kill -9 1341
[root@localhost ~]# umount /mnt
[root@localhost ~]# df
Filesystem                   1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root  19166504 3280692  14912196  19% /
tmpfs                           243140       0    243140   0% /dev/shm
/dev/sda1                       495844   33455    436789   8% /boot

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Code