As part of an automated VM creation system a block device is mounted to a temporary folder ( /tmp/whatever ) . Various scripts install and configure the VM prior to it's first run.
Recently something changed, the temporary mount is busy and refuses to umount. In trying to determine what might still be keeping a file open I've checked:
Tests run as root
- lsof | grep /tmp/
- fuser -m /tmp/...
- exportfs -rv
- Restarting the daemon which runs the creation scripts anyway...
- ps axf
- dmsetup table
- losetup -a
- fuser -vm /tmp/tmp.random-chars/ (yields two lines)
- USER PID ACCESS COMMAND
- /tmp/tmp.random-chars: root kernel mount /tmp/tmp.random-chars
None of the above tests have results that point to filesystem use, however umount -f still complains "Device or resource busy" / "device is busy".
What other tests should I try so that I can get to the true root cause and thus hopefully fix the stuck mount without reboot on a system I can't presently restart for a while as well as prevent this from reoccurring?
It is also /doubtful/ (but I don't know how to check) that kernel modules from the temporary mount are loaded, as the temporary mount has a different version of Linux installed than the host is running.
- From various search results it appears that /modules/ are simply read in to memory. I am unaware of if the kernel could have open files and of how to access any such list.
- Added the dmsetup / losetup to the lists of "tests that don't show issues"
- fuser -vm as suggested in freenode ##linux