October 4, 2008

Duplicate, ghost AFP and SMB Leopard Mac OS X shares - Solution

Use the dscl command in the terminal application to delete duplicate SharePoint names if your Apple Mac OS X Leopard 10.5.1 system is advertising multiple or suffixed shares (-1, -2, etc). Execute sudo dscl, then cd /Local/Default/SharePoints. With an ls, you can see the share names. Stop file sharing from the Sharing Preferences pane, remove the share from the Shared Folders window and uncheck Shared Folder from Get Info on the folder or volume being shared. Next ls in dscl again and if there are still duplicates, delete them all with delete yoursharename in dscl. Next restart File Sharing in Preferences and add shares with the Shared Folders checkbox in the Get Info window. Do not add shares with Shared Folders in the File Sharing Preferences.

Leopard has a problem that somehow causes APF and SAMBA SMB shares to be duplicated with a suffix of -1, -2, -3, etc. Mac OS X shows the share with the highest suffix, SMB browsers show all the share names. The above instructions will fix AFP problems. To fix SMB problems, it might be necessary to use the Finder or Terminal to delete all the share name files in /var/samba/shares while File Sharing is turned off. Leopard will re-create all the samba files based on the SharePoints viewable with dscl.

Apple doesn't seem to be aware of this issue. At least one other person is having this problem as discussed in the Apple Forums Thread 1316884. First level and "product specialist" at Apple Support did not know how to fix this issue. The "product specialist" stated that it was caused by an "echo" due to "redundant" use of Screen Sharing, File Sharing, Web Sharing and Remote Login. According to the Specialist, "that many services are not to be used simultaneously". Of course, we know that Specialist was wrong.

It appears the problem is inconsistent information between the Shared Folders list in the File Sharing Preferences pane and the check box in the Get Info window. It has also been noticed that shares disappear from the Shared Folders File Sharing Preferences when they are still advertised on the network. By using the share folder check box in Get Info, the problems in the Shared Folders pane may be avoided. In other words, don't pay any attention to the Shared Folders list. Do all sharing and permissions from the Get Info window.

This problem was experienced trying to establish a file server system in the home. The need is for file and print services available to Windows XP, Linux and Mac OS X systems. An iMac and a MacBook Pro were used to set up the system and it has not been easy. SMB sharing was all but abandoned when the multiple shares were showing up on the Windows XP systems. When the share suffixes showed up on AFP shares on the MacBook Pro, it was very disappointing. This workaround to the Leopard bug may rekindle the effort to establish a Leopard file server for Windows XP clients.

Thanks to a friend, that can fix all things computer, who revealed the dscl utility.

4 comments:

  1. thanks a thousand times, been banging my head all day

    ReplyDelete
  2. What about if users are connecting to the nonexistent duplicate sharepoint folders and it won't let me delete them?

    ReplyDelete
  3. Solution works on 10.10 Yosemite. Paul, thanks for keeping the solution up for the past 7 years.

    ReplyDelete