Weird Networking Question

AKMedia

Registered
I have a local network of 3 Macs, one of which running 10.1.2. When I connect to one of my Macs (running OS 9.1) from the one running 10.1.2 using the Finder's Connect to Server (either via the Local Network or AppleTalk lists) the finder appends a "-1" to the end of the server name (i.e., "Macintosh HD-1" instead of just "Macintosh HD") when its icon appears in the Finder. This seemed to start happening after the server closed down unexpectedly a week or so ago. Anyway, I'm hoping someone knows why this is happening. I know it's not a big deal. I can connect and use the server with no problem (I suppose this may be just a cosmetic glitch) but I'm curious to know if I can fix it.
 
It may be more than cosmetic if you've applications that rely on the volume name to find stuff (iTunes). I had this happen once, and although the details are foggy (it happened in the 10.0.3-10.0.4 days), heres what I did to fix it:

1. Disconnect the remote volume that's affected.
2. Open a terminal and cd to /Volumes
3. You should see a placeholder (directory? I don't remember) for the affected volume that doesn't have the -1 suffix. It should be a simple file/directory. If it's a directory, you should be able cd to it and confirm that it's empty.

Note: it is critical that it be empty before proceeding. If you see files in the directory, do not proceed. Instead, try to determine whether there is still a mounted volume there (using mount, or 'df -k' or whatever) and unmount the volume first. I disclaim any responsibility for lost data if you skip this step.

4. Remove the directory.
5. Reattach the remote volume (in Finder). It should now be free of the -1 suffix.

As I said, it's been a while since I last saw this, and I'm unable to reproduce the issue now (I'm on 10.1.2). The placeholder should be a directory, but I honestly don't remember for sure. Also, you'll probably need to use sudo to remove the directory.

Hope this helps...
 
Kenny, thanks for the reply. I'm a UNIX newbie so I'm hoping you might be able to walk me through the 2 steps in Terminal you mentioned (before proceeding to deleting the errant directory). First, what do I type to get a listing in Terminal of what Volumes are mounted and then a listing of files in that Volume? Second, what do I type to Unmount that volume? (If Unmounting doesn't work, I suppose I will need to know what to type to delete the directory as well...) I really appreciate the help and maybe you could direct me to a good book on UNIX that would help me to learn more about the OS. Thanks.
 
No problem. I actually figured out how to force this to happen, so I'm a little more clear on the details now...

For this example, I've got a remote volume called "Belgium" that I've forced to misbehave as you mentioned.

Here's what to do:

1. Make sure that the volume with the -1 suffix is no longer on the desktop. Eject it, drag it to the trash, whatever, to unmount that appearence of the volume.

2. Open terminal, and type 'mount' and hit enter. You should see output that looks similar to this:

/dev/disk0s9 on / (local)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol (read-only)
automount -fstab [240] on /Network/Servers (automounted)
automount -static [240] on /automount (automounted)


Make sure that your "-1" volume doesn't appear here.

For example, you do not want to see a line that looks like this:

afp_0TT6CG0TShSm0TQ51j0Yb4rH-1 on /Volumes/Belgium-1 (nodev, nosuid, mounted by kenkl)

To unmount this volume I would enter "umount /Volumes/Belgium-1" and press enter (no quotes, of course). If you get a message that the volume is busy, close any applications that may be using files on the volume and try again.

If you still can't get it to unmount, you may have to restart to clear this. In any case do not proceed to the next step until you see no entries for "afp_" in the output of "mount".

3. Again, in terminal type "cd /Volumes" hit enter, then type "ls -l" and hit enter. You should see output that looks something like this:

iceman:/Volumes> ls -l
total 0
drwxr-xr-x 3 kenkl wheel 58 Dec 22 12:04 Belgium
iceman:/Volumes>


Next, you need to check that the directory is (practically) empty. For our example, I would do this:

iceman:/Volumes> ls -la Belgium
total 8
drwxr-xr-x 3 kenkl wheel 58 Dec 22 12:04 .
drwxrwxrwt 3 root wheel 58 Dec 22 12:04 ..
-rw------- 1 kenkl wheel 11 Dec 22 12:04 .autodiskmounted
iceman:/Volumes>


Of course, you'd substitute the name of your 'stuck' volume name in the "ls -la" command, but you should see similar output. If you see the contents of the network volume, stop right now and go back to step 2 to make sure that the volume is not mounted.

4. Now, it's time to remove the 'stuck' directory:

iceman:/Volumes> rm -r Belgium
iceman:/Volumes>


If you recieve a permission error, try this instead:

iceman:/Volumes> sudo rm -r Belgium
Password:
iceman:/Volumes>


When prompted for your password, enter your password.

As before, replace "Belgium" with the actual name of your volume.

Once you've done this, you should be able to do "ls -l" again, and the directory should be gone.

5. In Finder, reconnect the Volume. It should now appear without the -1 suffix.

If your volume name has spaces in it, you will need to surround it with quotes in these examples. For instance, if I used a volume that was named 'Drop folder', the commands would look something like this:

iceman:/Volumes>ls -la "Drop Folder"

Hopefully, this will clear it up for you. As for book recommendations, I learned a lot from the O'Reilly books "Essential System Administration", "Linux in a Nutshell" and "Unix in a Nutshell". Also, of interest is the Solaris administration documentation. Obviously, MacOSX has some differences from Linux and Solaris, but for the basics used here, they are useful. Also, command references are available on the system using the man command. So, to learn more about "ls" you can have a look at "man ls". Most of the Unix commands have man entries, and are often very valuable in learning your way around the system.

Let us know if this helps... :)
 
Kenny, thanks for this! I will try it today or tomorrow and let you know how it works out. UPDATE: Just tried it and it worked!! Thanks again Kenny. Your instructions were flawless!! Terminal can be a scary place but you certainly made it feel safer to use the command line.
 
What I did was to mount Belgium with finder, then I went to a terminal and unmounted it by hand ('umount /Volumes/Belgium'). Apparently, Finder doesn't keep track of volumes that are unmounted in this way, and doesn't clean up the /Volumes directory automatically when that happens. Probably the same thing can happen if the volume disappears unexpectedly in the right circumstances (not always, but enough to cause problems on occasion).
 
Back
Top