there are a lot of similar problem like "Device or resource busy". But I think my problem is different with them.
I use mount --bind to bind a directory
mount --bind /tmp/origin /tmp/mount
and then could umount successfully
umount /tmp/mount
And then if I call rm at once
rm -rf /tmp/mount
I could get a error Device or resource busy
. If I wait 2~3 seconds, and then call rm, it could success.
So this behaviour is very strange here. I try use
lsof +D /tmp/mount
could not see anything.
I also use fuser -vm /tmp/mount
, could not see any process hold this folder.
I compare the /proc/mounts
before umount /tmp/mount
and after umount /tmp/mount
. /tmp/mount
has already removed.
I compare the stat /proc/mounts
before umount /tmp/mount
and after umount /tmp/mount
. The inode also different, this means /tmp/mount
has already removed complete.
Even I call sync && echo 2 > /proc/sys/vm/drop_caches
and try to drop file caches, it still not work.
I try this in both Ubuntu 14.04 and CentOS 6.6. They have same results.