I have an encrypted drive on my mac - it's a dmg file under my home directory.
I mount it when I need to work on the files inside (obviously). In reality, this is "almost all the time". IE after I log in, I mount the drive, and there it stays.
The problem that I'm having is when for some reason I reboot my mac (and, possibly other times that I have not diagnosed yet) this drive appears to not get unmounted cleanly, and leaves a ghost folder in /Volumes.
That becomes a problem because when I mount it the next time, a folder with a different name is created in /Volumes, and then any paths I had that were pointing to the original no longer work (email client's email folder, for example).
How can I avoid this?