There are many similar issues, such as "Device or resource busy." But I think my problem is different from them.
I use mount -bind to bind a directory
mount --bind /tmp/origin /tmp/mount
and then you can run it successfully
umount /tmp/mount
And then if I call rm right away
rm -rf /tmp/mount
I may get an error message Device or resource busy. If I wait 2 ~ 3 seconds and then call rm, this may succeed.
So it’s very strange here. I'm trying to use
lsof +D /tmp/mount
did not see anything.
I also use fuser -vm /tmp/mount, I don’t see any process holding this folder.
I compare /proc/mountsbefore umount /tmp/mountand after umount /tmp/mount. /tmp/mountalready deleted.
stat /proc/mounts umount /tmp/mount umount /tmp/mount. , , /tmp/mount .
sync && echo 2 > /proc/sys/vm/drop_caches , .
Ubuntu 14.04, CentOS 6.6. .