I have the following issue on Snow Leopard (10.6.8) after mounting a network drive (⌘+K in Finder. When I disconnect the laptop from the network without dismounting the drive, I get the Finder notification that the drive is no longer available, where I usually click "Disconnect All". This still leaves a leftover directory in /Volumes
, which doesn't get deleted.
So if I mount the drive foo
, a directory /Volumes/foo
is created for the mount. This directory is still there after disconnecting the network cable and confirming to disconnect the drive. The next time I mount the same foo
share, a new directory /Volumes/foo-1
is created etc.
This is causing some trouble with scripts (or Unison, which I point to /Volumes/foo
), since the expected mount point is not the same (/Volumes/foo
is empty in this case).
Is there any way to automatically remove this directory after the disconnect I described above?
This happens to me on a regular basis when I put the MacBook to sleep, remove the network cable and then want to work e.g. on the train without being connected to the network.
Update
After observing this issue for a couple of months now (I'm still on Snow Leopard), I've noticed the following: The folder /Volumes/foo
is not removed even with the network cable in when removing the mount through Finder. To clarify:
- Open Finder, press ⌘+K
- Select a Samba drive to mount, e.g.
smb://server/foo
- This will be mounted in
/Volumes/foo
, make sure you can browse it through Finder - Click the
Eject
button next to the share in Finder - The directory
/Volumes/foo
is not removed
As a consequence, when I try to mount the same share again, another directory /Volumes/foo-1
is created, etc.