How to remove duplicate "ghost" network drive on OS X?
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Switch On Looping
--
Chapters
00:00 How To Remove Duplicate &Quot;Ghost&Quot; Network Drive On Os X?
00:47 Answer 1 Score 4
01:16 Accepted Answer Score 15
02:58 Answer 3 Score 0
04:26 Answer 4 Score 0
04:32 Thank you
--
Full question
https://superuser.com/questions/20879/ho...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#macos #terminal #logicaldrive
#avk47
ACCEPTED ANSWER
Score 15
Mac OS X mounts drives by default by creating a folder with the name of the drive in /Volumes
and then mounting it at that point (so a drive is normally accessible via /Volumes/NAME_OF_DRIVE
). Mac OS X will append a -#
after the name of a hard drive if multiple drives of that name are mounted. (eg. /Volumes/NAME_OF_DRIVE-1
and /Volumes/NAME_OF_DRIVE-2
, etc.) This will also occur if a folder exists in /Volumes/
by that same name. Even though the mount point has a different name the name of the drive will show correctly in the Finder.
An example of what can cause an erroneous folder:
A script or application that writes a file to /Volumes/ExternalDrive/somefile.txt
or even an application that when checking if a file exists (eg. open last saved document) creates a new document at that location when the hard drive/network share/USB key/etc. is not mounted. The file will exists at /Volumes/ExternalDrive/somefile.txt
meaning the folder /Volumes/ExternalDrive
will exist when you next mount.
Fixing this:
- Ensure all drives have been unmounted - use Disk Utility or
diskutil list
to be sure - Check to see what can be seen in
/Volumes/
- recommended to use the Terminal and usels -laF /Volumes
. There should only be one folder (NAME_OF_STARTUP_DRIVE -> /
) - Delete the remaining folders. (I'd recommend checking the contents first)
ANSWER 2
Score 4
Ok, so I first turned off my drive to make sure nothing was deleted.
Then in terminal I typed:
sudo rm -rf Lacie-1
Great news, this works. I turned my drive back on and everything was fine.
I did find the cause however when I tried to do my time machine backup. Time Machine is actually creating this ghost drive for backups. I don't know why.
ANSWER 3
Score 0
Here's how I resolved it... and more importantly, what caused it.
Cause
A friend came over and connected to my network while I was using my machine. Their machine, rightly so, showed up in my Finder shares (as a remote drive). During this time, I closed my laptop and it went to sleep -- remembering that it had shares.
A little later I woke my laptop at a hotel, and knowing there was a network I didn't trust, I turned off Apple / Preferences... / Sharing, File Sharing before connecting. It wasn't until days later at home I noticed the ghost machines still in Finder with no way to delete them.
Solution
I went back into Apple / Preferences... / Sharing, File Sharing and turned ON File Sharing (the machines vanished), then I turned OFF File Sharing (they stayed vanished).
Suspicion
I believe this is an edge-case bug, where Finder does not check shares unless it is connected to a network, and if the File Sharing option is turned off while disconnected, it never polls (since 'obviously' you're not sharing anything) to remove stale entries.
FYI, I have logged this as a bug with Apple, # 19977714.
Again, still assuming this is what's happening, it seems that Finder should on either no network or discovering that option is off, remove all Shares and then it doesn't have to check anymore.
ANSWER 4
Score 0
This should also be fixed by rebooting.