Page 1 of 1

Stop Mac from mounting volumes with -1

PostPosted: Wed Mar 27, 2013 10:01 am
by tscibilia
Problem
I have a synology NAS that hosts and streams all my Media and most of my documents. I've been recently been having problems with iTunes, Hazel (viewtopic.php?f=4&t=2020), and other applications due to the Volumes folder on my mac having many mounted volumes of the same name ... or so I thought. in actuality most of the Volumes were actually Media-1, Media-2, etc.

Solution:
I set up a Hazel script to monitor and delete these bogus Volumes as follows
/Volumes
Unmount Drives with "-#"
• If <all> conditions met for <the file or folder being matched>
<Name> <Contains> - (i used the hypen symbol since all volumes have a -1 appending the volume name and none of my volumes have a hypen in its name)
• Do the following
<Run AppleScript>
Code: Select all
tell application "Finder"
   eject disk theFile
end tell


Log Result:
2013-03-27 09:49:27.857 hazelworker[62364] home-1: Rule Unmount Drives with "-#" matched.
2013-03-27 09:49:29.260 hazelworker[62364] home-2: Rule Unmount Drives with "-#" matched.
2013-03-27 09:49:31.105 hazelworker[62364] home-3: Rule Unmount Drives with "-#" matched.
2013-03-27 09:49:35.017 hazelworker[62364] home-4: Rule Unmount Drives with "-#" matched.