linux-umount时提示device is busy时,如何查找被何进程占用?

umount时提示device is busy,如下:

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

这时,可以使用fuser命令来查看:

# fuser -vm /data/disk1
USER        PID ACCESS COMMAND
/data/disk1:         root      17330 F…m dataserver

即可知道是pid=17330的dataserver占用了该目录

停止对应服务,即可umount成功

Leave a Reply

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