The normal way to find what is preventing a filesystem from being unmounted is to list the processes that have a file open on it (or a file descriptor, or their current directory, etc.):
fuser -m /path/to/mount/point
Review the list of processes and kill them if warranted.
There are also a few ways in which the kernel itself can have something going on that prevents the unmounting, for example if there is another mount point beneath it (e.g. you can't unmount
/mnt/chroot/proc is mounted).
When you have bind mounts, commands such as the one above list files open via any of the paths to the filesystem. So for example
fuser -m /mnt/chroot/run lists processes that have files open on that filesystem, whether they're accessed via
/run or via
To find what is using the mount point, list the processes and the paths via which they have files open, and do some filtering on the paths. For example:
lsof /mnt/chroot/run | grep /mnt/chroot
or to get them all
lsof | grep /mnt/chroot
or you can access
ls -l /proc/[0-9]*/fd/* | grep /mnt/chroot
For automated processing (assuming a recent
sed that supports
-z for null delimiters):
find /proc/[0-9]*/fd -type l -printf '%p %l/\0' |
sed -nz 's!^/proc/\([0-9]*\)/fd/[0-9]* /mnt/chroot/.*!\1!p' |
If you really can't find what's holding a filesystem mounted but you need to get back the mount point, you can move the mount point out of the way by creating an empty directory somewhere and running
mount --move /current/mount/point /empty/directory/out/of/the/way. You can also do a lazy unmount (
umount -l), which causes the filesystem to have no mount point at all (so files on it can't be opened anymore) but still be mounted as long as there are open files or other references on it.