I've got some samba drives that are being accessed by multiple users daily. I already have code to recognize shared drives (from a SQL table) and mount them in a special directory where all users can access them.
I want to know, if I remove a drive from my SQL table (effectively taking it offline) how, or even is, there a way to unmount a busy device? So far I've found that any form of umount
does not work.
Ignoring the possibility of destroying data - is it possible to unmount a device that is currently being read?
YES!! There is a way to detach a busy device immediately - even if it is busy and cannot be unmounted forcefully. You may cleanup all later:
NOTE/CAUTION
umount
commands when inside mounted path (Folder/Drive/Device) itself. First, you may usepwd
command to validate your current directory path (which should not be the mounted path), then usecd
command to get out of the mounted path - to unmount it later using above commands.