"umount: /mount/path: device is busy" and "Device or resource busy while trying to open ..."

From Helpful

These are a bunch of quick jots worth noting down but not complete in any way (and probably won't make it up to well-written text and possibly not even stub status).


Just that; some files or directories are still in use, even if just by being a terminal's curdir, possibly somewhere in a tree of shells where one was started in a directory on the relevant device.


You can see which processes have things open, in this example for /mnt/data, by doing:

fuser -vm /mnt/data

The -m option lists all open files on a filesystem (on the filesystem the file reference is on). The v is for verbose, so that you get process names instead of just IDs.

...or:

lsof | grep /mnt/data