I have a small USB HD I've bought for doing daily backups, which has an encfs system on it.
I've got an
autorun script in the root that does a couple of things including mounting the enc-FS and that part works fine.
However if I forget to
fusermount -u the enc-FS -before ejecting it, there is no warning about anything and the USB dismounts, leaving the encFS part apparently still mounted. Of course it isn't really, and attempting to access with nautilus say, causes the machine to "behave badly".
There's also the risk of lost files I suppose.
For some reason the systems doesn't seem to detect the drive is still active as it normally does, in this scenario.
Anyway my question is, is it possible to set up the equivalent of an autorun-on-dismount that runs when the USB eject occurs?