Macos – Mac OS can’t connect to SMB shares after sleep

macosnetwork-sharesosx-snow-leopardsleepsmb

I used to access my local Windows 2008 file server's SMB shares on my recent (3 weeks old) MacBook Pro without problems. However, for a few days now, it fails to (re-)connect to the server after it woke up from sleep mode.

Finder just shows "connecting…" and hangs indefinitely. The same thing happens when I try it from the command line (mount -t smbfs). This happens via both WiFi and cable, I also tried turning networking off and back on. The only thing that helps is a reboot.

Any hints?

Edit to clarify: It's the Mac that's being put to sleep, not the server. I also found out that if I disconnect the shares before I put it to sleep, it will be able to reconnect after waking up.

Another Edit:

I did some more investigation and sniffed the network traffic. The Mac sends NetBIOS name queries and a status request (NBSTAT) to the server, the server responds, everything seems fine. After that, the Mac should open a SMB connection, but it doesn't do anything. No more packets follow.

I then found out that the real problem lies deeper. It seems it doesn't open a new connection because it thinks the old one, which has of course timed out on the server side, is still active. However, any program that tries to access its mount point or just the /Volumes directory hangs and can't even be killed. umount /Volumes/share – hangs. ls /Volumes – hangs. kill -9 any of these – doesn't help. Also, opening a file open dialog in any application causes it to hang as well!

The only thing that helps is a hard reboot. It seems to me there's something fundamentally wrong in OSX's SMB implementation if a timed out connection can trigger something like this.

Best Answer

I'm having the same issue with my MacBook Pro. I followed the instructions here - http://blog.djmnet.org/2009/02/09/macs-needing-unix-network-geekery/ and my issues seem to be resolved.