Chinaunix首页 | 论坛 | 博客
  • 博客访问: 433275
  • 博文数量: 481
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 1040
  • 用 户 组: 普通用户
  • 注册时间: 2013-01-06 14:09
文章分类

全部博文(481)

文章存档

2013年(483)

我的朋友

分类: LINUX

2013-04-17 15:31:46

原文地址: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.)

当引用不繁忙时, 直接卸载与之目录相关系的文件系统.  推荐后者.
阅读(152) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~