How to unmount from a script that runs on the mount point that needs to be unmounted?
How would you go about unmounting a mount point from a script that runs on said mount point?
It is clearly not possible with a plain:
since this will immediately unmount the mount point, which will fail with the output
Device busy ...
In case you need to cut the branch the script is sitting on use:
-l Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)