umount device is busy


Linux 下的磁盘分区通过挂载(mount)的方式连到一个目录下, 打开此目录就可以看到该分区的内容, 与挂载相反的操作是umount, 它将磁盘分区与目录的关联关系解除.

最近在umount时报下列外, 如:
[root@media1 home]# umount /data
umount: /data: device is busy
umount: /data: device is busy

这说明还有某个程序正在使用此目录, 为了保证程序的运行, 默认情况下umount不能卸载. 但是umount没说是哪个程序正在使用. 
在Linux里有一个命令 fuser, 可以通过man fuser 看到具体的介绍:
Fuser - identify processes using files or sockets

#fuser –m 目录. 会显示使用目录的进程, 那么在umount之前, 可以先把这些进程先Kill.
另外就是使用umount –l 选项. Man umount
-l     Lazy  unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy any-more.  (Requires kernel 2.4.11 or later.)

当引用不繁忙时, 直接卸载与之目录相关系的文件系统.  推荐后者.
原文地址:https://www.cnblogs.com/feihongwuhen/p/7170415.html