How to remove duplicate "ghost" network drive on OS X?

14

3

In terminal my Volumes directory looks like this:

"Sanitized"-Computer:Volumes "sanatizedUserName"$ ls
Backup of "Sanitized"’s MacBook     Macintosh HD
LaCie                   iDisk
LaCie-1             

Somehow I have a duplicate "LaCie" drive and I can't access it to delete it. It is an Airport Drive. OS X must have a preference file somewhere it keeps of past network drives that I can delete.

It only mounts when the real drive is plugged in. I am afraid to delete this duplicate because it may delete real data.

I believe this "ghost" drive is screwing up my time machine backup.

Permissions:

"Sanitized"-Computer:Volumes "sanatizedUserName"$ ls -al
drwx------@ 26 root        wheel   840 Aug 10 18:41 LaCie-1

Thanks for any help.

Corey Floyd

Posted 2009-08-10T23:35:57.323

Reputation: 957

Answers

14

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 use ls -laF /Volumes. There should only be one folder (NAME_OF_STARTUP_DRIVE -> /)
  • Delete the remaining folders. (I'd recommend checking the contents first)

Chealion

Posted 2009-08-10T23:35:57.323

Reputation: 22 932

I know this is what happened: an app tried to write to the drive when it was disconnected. However, I had tried to delete this folder, but when time machine runs, it re-creates the folder. The "LaCie" folder has a minus sign (inaccessible). So it seems for some reason that Time Machine thinks that the backup is in "LaCie-1" not "LaCie". – Corey Floyd – 2009-08-11T06:38:16.763

I also deleted all Time Machine permisions (backupd and timemachine) and time machine STILL created the LaCie-1 folder. – Corey Floyd – 2009-08-11T06:39:20.613

I'd recommend unmounting the drives, remove any left over folders in /Volumes, turn off Time Machine then remount the Lacie drive and then re-select it using Time Machine. (Press Change Disk, change it to None, and then press Change again and select it properly) – Chealion – 2009-08-11T15:30:51.730

I have tried that numerous times. ...time machine always recreates the drive. – Corey Floyd – 2009-08-12T15:38:37.800

Is Time Machine saving your backups in a .sparseimage? – Chealion – 2009-08-12T16:27:58.963

Before I migrated, time machine was saving to a sparse image. I haven't let it save since it wasn't accessing the "real" disk. I have since installed my dev copy of 10.6 and it fixed the issue automatically. Your initial instructions on how to remove the drive and why it appears were helpful. Thanks. – Corey Floyd – 2009-08-15T05:54:51.753

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.

Corey Floyd

Posted 2009-08-10T23:35:57.323

Reputation: 957

I guess you should have also removed the stuck mount point sudo rm -rf Lacie – Munkymorgy – 2014-07-09T19:11:28.350

It's creating Lacie-1 because /Volumes/Lacie already exists. It's not related to Time Machine but how Mac OS X mounts external mounts (eg. external hard drives, network shares, etc.) – Chealion – 2009-08-11T02:35:03.770

0

This should also be fixed by rebooting.

Jack

Posted 2009-08-10T23:35:57.323

Reputation: 135

It probably could be fixed by rebooting, but I don't think it should be fixed. – mtak – 2017-05-23T20:49:14.420

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.

Walt Stoneburner

Posted 2009-08-10T23:35:57.323

Reputation: 185