Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

System issues resulting from disconnected SMB shares Network
I recently built myself a Redhat box (see this thread on the forum site) to take the development site serving workload off of my G4. I mount the Redhat's web server directory via SMB, so I can edit and test locally on my Mac with jEdit. Last night, I shut down the Redhat box without disconnecting the SMB share first. Bad bad move.

I had left jEdit running; it went spinning beach ball nearly immediately. So did the Finder. The terminal was open, so I headed there to try to see what was happening. I was pretty sure it would time out eventually, but I wasn't sure how long that would take. In the terminal, after typing cd /Volumes to see what was there, a simple ls crashed the Terminal.

A few minutes later, things tried to return to normal, but the Finder was still locked up, and even quitting and restarting it via the Terminal had no effect. Then the dock died. I finally wound up rebooting. I had a similar experience at work when I shut down my shared Windows machine before disconnecting the share on my iBook; you'd think I would've learned by now!

So if you're working with SMB shares (and perhaps other server types as well, I expect), be sure to disconnect them before shutting down the server! Also, if anyone has any workarounds to return the box to working order in a more timely manner (until Apple can hopefully fix this issue!), please post them here.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[22,342 views]  

System issues resulting from disconnected SMB shares | 24 comments | Create New Account
Click here to return to the 'System issues resulting from disconnected SMB shares' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Slow Connections Too
Authored by: eo on Jan 22, '03 10:43:28AM

Yes this also affects me when I mount SMB shares over a (relatively) slow Internet connection. Sometimes ALL apps will lock up for 10 - 30 seconds while waiting for a response from the server; I've learned to be a bit patient, because if the server does go down, the connection will timeout and things will return to normal. This may take up to 5 minutes of waiting.

I mount AFP volumes in the same manner, but never see any lockups.



[ Reply to This | # ]
Slow Connections Too
Authored by: deleted_user17 on Jan 22, '03 10:48:08AM

The same with AFP.

Apple please fix this. Finder and Apps are unusable with network connections that aren't always available!



[ Reply to This | # ]
Slow Connections Too
Authored by: eo on Jan 22, '03 10:51:05AM
Slow Connections Too
Authored by: feelgood on Jan 22, '03 02:29:53PM

To some degree it depends on the version of Samba that is running on the server. Make sure the server is up to date. Updating our servers didn't get rid of the slowness problem completely, but it helped alot (it is actually usable now)



[ Reply to This | # ]
not just SMB
Authored by: altglbrs on Jan 22, '03 11:08:42AM

I have similar problems connecting to a Novell fileserver over appletalk with 10.2. The server doesn't crash, and we're on a 100Mbps network, but our 10.2 machines freeze up when browsing or copying files. The freezes are kinda sporadic, yet very consistent (you don't know when its gonna crash, but it always does).

I'll try to copy some files and it will copy some, then it'll just stop. Spinning ball... Finder dies. Can't launch Terminal. Apps that are already running run fine until you bring up any open/save dialog, then they die. I can take a screen shot when its "crashed" so i know it able to write to the disk.. I can sometimes ssh in (depending on how much further i've crahsed it..) and things work fine until i try to navigate to anything on the remote volume, at which point the session dies.

Anyone know what might be going on? I'm thinking its novells appletalk service.. we're running netware 4 something..



[ Reply to This | # ]
re: not just SMB
Authored by: altglbrs on Jan 22, '03 11:15:59AM

oh yeah.. forgot to mention that waiting indefintely doesn't help... it never responds, i've waited over an hour. and it just sits there.



[ Reply to This | # ]
not just SMB - Novell
Authored by: pschrafl on Sep 30, '03 08:17:50AM

hi there

just wanted to let you know, that novell netware 4 is incompatible with mac os x (it's the novells appletalk implementation). you will need the newest netware (6 or higher) to work with mac os x and novell netware). hope this helps.

pascal



[ Reply to This | # ]
Re: System issues resulting from disconnected SMB shares
Authored by: pfurbacher on Jan 22, '03 12:15:04PM

This issue has plagued me for a very long time. At the end of the day, I always shut down my Win2K box, but leave this Powerbook running. If I forget to unmount the shares from the Win2K box, this Powerbook effectively becomes unusable, for an eternity. I have to reboot the other machine, unmount, and then shut it down, just to continue doing some work.

Quite a while ago, I submitted a bug report to Apple on this issue: At least, there ought to be a better time-out length (currently, it doesn't seem to ever time-out). I don't recall what their response was, but I bet that if a good number of bug reports were filed on this issue, they might actually think about doing something to resolve the problem.

So, if you do have a problem with this, such that it affects your productivity, please file a bug report at http://bugreport.apple.com. You'll be doing all of us a favor.

Thanks.



[ Reply to This | # ]
Linux Too
Authored by: prk on Jan 22, '03 12:25:42PM

I get the same problem in Linux when the server goes down and I have NFS mounts. I have learned a long time ago; Unmount the file server before shutting down the file server. My Mac seems to be worse at recovering from the lost file server.



[ Reply to This | # ]
Terrible Troubles
Authored by: ylon on Jan 22, '03 01:45:42PM

This issue has been around for a very long time. I reported this to Apple at least as long ago as last fall or summer. I have received no response from them either. It has been very upsetting while working with a laptop. I have had serious crashes (file system corruption) a couple of times due to this as restart just won't complete once this mistake has been started.

Apple please help! (As I said, I have reported this actually a few times through the appropriate channels, and it is still lingering out there.)



[ Reply to This | # ]
in general the /Volumes filesystems have problems
Authored by: simonlok on Jan 22, '03 03:04:10PM

I have experienced more problems than I care to admit. In general I have found that anything to do with /Volumes is extremely brittle. For example, if you accidentally try to mount a Windows share using something like smb://10.0.12 (note that I have a typo, I left out the dot between the 1 and 2), then the machine will throw an error message. Twenty seconds later, the operating system will kernel panic. If you accidentally pull the ethernet plug out, and then startup any program that searchs /Volumes, the machine freezes with the spinning beach ball. Something less serious is the way that invalid passwords are handled. A dialog box is popped up, then you have to start again from the connect dialog box. It's all really upsetting actually. The reason why I switched was to get more stability. Unfortunately, this aspect of the OS X really needs serious work.



[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: patjensen on Jan 22, '03 03:20:01PM

Back in the day, if you used NFS and mounted your volumes off of a file server, you had the choice to use what were called soft mounts and hard mounts. Hard mounts let the kernel and the file system buffer every file operation (reads and writes). If the file server went off line, any file operations would "hang" and wait for it to come back up before the operation was completed. This includes things like listing the directory even. This was good if you wanted to prevent data loss at the cost of waiting for the server to come back online.

Soft mounts would let the file system driver gracefully release the connection, and give an error to any user applications but not preserve the file operation (reads and writes). The SMB filesystem driver is capable of doing this, for more information type "man mount_smbfs" in your Terminal window. Something along these lines may do the trick:

mount_smbfs -R2 -T5 //PATJ@JUDY/MUSIC /Volumes/judy

This would mount a share called MUSIC on JUDY with the username PATJ to /Volumes/judy. The trick here is the -T5 which means timeout after 5 seconds of no response, and -R2 which means retry the file operation twice before giving up. To close the share, you can either drag it to the Trash from the Finder, or enter in umount /Volumes/judy at a Terminal prompt. If you are mounting a volume over a dial-up or slow WAN link, you may want to adjust these timeouts to what works for you.

This should alleviate your problem with having your processes hang awaiting a response. I'm unsure of what the default timeout is without looking at the source. Try this out by mounting your shares from the Terminal and see if it helps you.

Hope this helps. Cheers.

-Pat



[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: phc on Jan 23, '03 02:49:27AM

I'll have to keep this tip in mind next time I mount shares remotely as I just happened to run into this exact problem the other day.

In the event that you use mount_smbfs without any options...

umount ./theShare

also works; but as I discovered everything had locked up, I had to login from a different computer and issue "umount". And then a restart fixed everything.



[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: bax on Jan 23, '03 06:42:29AM
An option to enable these settings on all mounted shares would be to rename /sbin/mount_smbfs to e.g. /sbin/mount_smbfs.bin and writing a script named /sbin/mount_smbfs with the following contents:
#!/bin/sh /sbin/mount_smbfs.bin -R2 -T5 $@
Don't forget "chmod +x /sbin/mount_smbfs".

[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: xApple on Nov 12, '06 08:47:42AM

Very intresting !
I've been searching the net for some time now on how to change the default timeout time before disconencting... The Finder has a much too long one !
Was hoping it would just be a parameter to change in some obscure file with the proprety editor... but whatever solution it is...

So could you be a bit more precise on how to do such a thing ?

Thanks a lot ! Your help is greatly appreciacted



[ Reply to This | # ]
Filesystem Timeouts (addendum)
Authored by: patjensen on Jan 22, '03 03:24:19PM

If for some reason, you are locked up and you want to see what is still open on the volume that is offline, you can use this command in Terminal to see what is currently open:

fstat /Volumes/judy (substitute one of your drives here, local or network)

This will show what is open and what program is using it. Hope this helps. Cheers.

-Pat



[ Reply to This | # ]
Here's a script to Help
Authored by: kb5ql on Jan 22, '03 07:39:47PM

I have written the perl script below - it quits all of my open applications, then it unmounts any ejectable disks. You can place this in your ~/Library/Scripts folder and chmod 755 it to run it from the menubar (assuming you have the ScriptMenu.menu installed there). The reason for quitting all applications is so you don't get a "file in use" error when attempting to unmount. You can customize it by adding applications to the excluded_list array.

name the file with a *.pl extension


#!/usr/bin/perl -w

###############################################################################
#
# File: goHome.pl
#
# Function:
#
# Author(s): MGJ
#
# Copyright: Copyright (c) 2003 MGJ
# All Rights Reserved. Please keep the header intact
#
# Source: Started anew.
#
# Notes: This quits all open applications - except those in the excluded list
# and then unmounts all network volumes -
# Finally - it prompts you if you want to put the computer to sleep
#
# Change History:
# 1/16/03 Started source
#
#
##############################################################################
use strict;

my (%appList,$theAppString);
my $osascript_name = "/tmp/goHome.scpt";

my @excluded_list = ("Script Editor","Microsoft Database","Show Desktop","PTHClock");

#grab all command output
my @output = `ps -xwwwwo command`;

foreach my $line(@output)
{
if ($line =~ m|^/Applications/.+/([^-]+)( -psn.+)?|)
{
my $match = $1;
if($match =~ /(.+)\s+/) { $match = $1; }
#print "$match\n";
$appList{$match} = "t";
}
}

foreach my $element (keys %appList)
{
# print "testing $element\n";
foreach my $excluded(@excluded_list)
{
if ($element =~ /$excluded/)
{
#print "i found a match -> $excluded\n";
#set flag to false (don't quit these apps);
$appList{$element} = "f";
}
}
}
foreach my $element2 (keys %appList)
{
if ($appList{$element2} ne "f")
{
if ($theAppString)
{
$theAppString .= ",\"$element2\"";
}
else
{
$theAppString = "\"$element2\"";
}
}
}
(my $osascript = <<"eoj") =~ s/^\t+//gm;

property theApps : {$theAppString}

repeat with x in theApps
set theApp to x
tell application theApp
quit
end tell
end repeat

tell application "Finder"

set startupDisk to name of startup disk
set theDisks to every disk whose (name is not startupDisk and ejectable is true)
repeat with x in theDisks
set diskName to name of x
--display dialog diskName buttons {"Cancel", "Space", "Return"}
try
eject disk diskName
end try
end repeat
end tell



tell application "Finder"
display dialog "Do you want to sleep?" buttons {"Cancel", "Yes"}
sleep
end tell

eoj

#print "$osascript";


open(OUTFILE,">$osascript_name");
print OUTFILE $osascript;
close(OUTFILE);

system("osascript $osascript_name");



[ Reply to This | # ]
Need to modify eject volumes (possibly)
Authored by: kb5ql on Jan 22, '03 07:44:33PM

I forgot to mention that you will probably need to modify the applescript (located at the bottom of the script) if you have volumes (other than the startup volume), you don't want unmounted. This isn't a problem in my setup since I want ALL of my volumes unmounted (including my external firewire drive).



[ Reply to This | # ]
mount and umount
Authored by: stev0621 on Jan 23, '03 09:41:44AM

If you simply type: mount
in the terminal it will give you a list of everything mounted on your system including shares. The shares generally show up at the bottom like: //USER@MACHINE/SHARE on /Volumes/SHARE. Should you want to unmount a share simply tpe: umount /Volumes/SHARE

This tip can also help if the share is not properly unmounted when you eject it. If you have connected to a share, disconnected, and tried to reconnect later you may receive an error something like this:
Connecting to smb://YOURSERVER/YOURSHARE
An error has occured (error = -47)
This typically means that the share did not unmount properly. It may not be visible on your Desktop, but if you use the mount command you will see that it is still mounted under the /Volumes directory. Simply unmount via the umount command then try remapping the drive.

Steve



[ Reply to This | # ]
Discussion Thread at Apple.com
Authored by: silas on Jan 23, '03 12:18:41PM
There's also a discussion thread on this topic on the Apple site. But I'm glad to see it brought to light on macosxhints.com...I've been having this issue for a while and it's SO frustrating. Sometimes it borders on the absurd...the last time it happened to me, the fix was to re-establish a VPN connection to my office network, which required opening up a new hole in the company firewall, which required SSHing through about 3 different boxes. Once that was done, I could allow the mount to refresh itself, and then unmount it. Not so convenient. :)

[ Reply to This | # ]
solution!
Authored by: ewelch on Jan 23, '03 07:03:41PM

I may have found (bought) a great solution to the SMB mounting problem. Dave 4.02 for OSX.

I just had a network connection go down, and I was expecting the usual long dismount disco, and lo and behold, Dave pops up with "A network share forceably went down" or some thing like that, but forceably was used. Then it said I should remove the volume from my desktop. Well, it wasn't there because I have so many volumes mounted at the same time that it would clutter the place up. So I went to finder and clicked on the shared volume that was still in the list, and hit eject and pop, it was gone.

If you ask me, DAVE is worth every penny for all the things it's solved for me in the past week! I'm sold! (I do NOT work for Thursby or have any connection other than being very happy to have bought 20 licenses.)

Make sure you get the absolute latest version, 4.0 does NOT work with Jaguar.



[ Reply to This | # ]
Any kind of mount does that...
Authored by: frigaut on Jan 24, '03 06:55:54AM

On my part, I haven't had serious trouble with SMB mounts. I get the spinning wheel if I forget to unmount it, but I generally can get access to the "eject" if I am a little patient. I get however the same kind of *serious* problem with NFS mounts as the one described in this thread for SMB moutns. I found that NFS mounts are generally a killer, if I forget to umount them before I get offline or change subnet. In fact, about 99% of my forced reboot (often by having to power down forcefully) is due to this NFS mount problem. As described, the computer locks up, apps after apps, until the system is completely locked up and a forced powerdown is my only solution.
Apparently, soft mounts do not solve the problem (not extensively tested as I only got the hint from this list yesterday), but I'll experiment some more (thanks for the trick provided in this thread).
I am using mount_nfs -i -b -s ..., may be I need to explicitely specify a timeout with -x or -t ?



[ Reply to This | # ]
Workaround with fink
Authored by: eyesee on Feb 06, '03 08:34:09AM
In my local network I use samba on a linux box to connect my iBook to my shares. I suffered a lot from the crash-bug, 'till I got a workaround: If you enter
smbd -V
in the terminal you get the current version of the samba-daemon provided by the system. MacOS X 10.2.3 currently uses version 2.2.3a and while in fink is version 2.2.7a available, which does not crash by my experience. So if you got fink running on your Apple try to replace the samba-daemon by the one provided in fink by typing:
fink install samba
This also should work with the binary install method:
apt-get install samba
The description of samba-2.2.7a for fink recommends the following procedure:
Description: SMB and CIFS client and server for UNIX Samba is a free SMB and CIFS client and server for UNIX. This install of samba has both ssl and cups support. Usage Notes: Samba settings are set in the configuration file 'smb.conf'. installed in yourfinkdirectory/etc/samba. To enable this version of Samba instead of the version installed with 10.2 do the following; 1. Backup the default 10.2 Samba startupitem found in /System/Library /StartupItems, incase ever needed. 2. Replace the default 10.2 Samba startupitem with the startupitem found in yourfinkdirectory/share/samba/StartupItems. Please note if you have fink installed outside of the default 'sw' you will have to edit the startupitem to point it towards your fink install. 3. Finally highlight "Windows File Sharing" in the System Preferences, "Sharing" under the "Services" tab and press "Start". To enable Swat do the following; 1. Add the following line to "/etc/inetd.conf"; "swat stream tcp nowait root /sw/sbin/swat swat" and 2. Add the following line to "/etc/services"; "swat 901/tcp", reboot then 3. Open your favourite web browser and point it at http://localhost:901/
The timeouts, when aborting the connection to the server, are not "solved", but this way hopefully the kernel does not panic. I also heard rumors, that the stability of samba will be improved in the future release of MacOS X 10.2.4, but untill then this would be a workaround.

[ Reply to This | # ]
System issues resulting from disconnected SMB shares
Authored by: AMATECH on Aug 26, '03 11:29:25PM

Guys, the DDE fix did it for me. That's sensational and thank you very much. It was driving me crazy for 12 months. All I could do previously was do a reinstall/repair of Win2K Server and it'd work for some undetermined period then break for no reason. What I have noticed is that connections are likely to break after installing apps on the Win box, but could never find what actually changed.
Again, thanks.



[ Reply to This | # ]