How to fix OSX client to Windows share hangs?

16,115

Solution 1

Nope, Apple is replacing Samba in 10.7 because it's GPLv3. (And Apple is avoiding GPL like plague. See, they're also slowly moving away from GCC).

Now, to answer the original question, it seems like the connection is "simply" lost. And as the mounting is done at the kernel level, it can completly hang the machine.

I think your issue comes from a sudden loss of network connectivity. Here's what I would look for :

  • A change of IP address (server or client) : maybe a DHCP lease is expiring ?
  • Maybe some form of WiFi issue if you're over WiFi

Solution 2

This is probably a bug in samba, Apple is replacing it in 10.7 for just these reasons.

That being said I would assume your connection is dropping and not being re-created. Take a look at this post where users are having similar issues: https://superuser.com/questions/144327/mac-os-cant-connect-to-smb-shares-after-sleep

Share:
16,115
Andrew Dunkman
Author by

Andrew Dunkman

Updated on September 18, 2022

Comments

  • Andrew Dunkman
    Andrew Dunkman almost 2 years

    I have 2 x MacBook Pro's (OSX 10.6.7) that access files stored on a 64-bit and a 32-bit Windows 7 PC.

    The MBP clients can connect to the Windows shares and transfer files with no problem.

    However, after a day or so, the shares become unresponsive. If you click on the server name under "SHARED" in Finder, you get a "Connecting..." status message. Once this happens neither PC can be accessed.

    In Terminal, the network shares show as mounted. If you try to access the mounts, e.g. "ls /Volumes/data", the command hangs and cannot be ctrl/C'd.

    The shares cannot be unmounted, eg. sudo umount -f /Volumes/data" hangs as well.

    The only way to restore access to the Windows computers is to reboot the MBP's.

    Any suggestions on how to prevent this happening, diagnose the cause, or restore service without a reboot would be much appreciated.

    • Admin
      Admin about 13 years
      FWIW, I get the same thing with Win 7 shares but have no problems with Server 2003 shares.
    • Admin
      Admin about 13 years
      Does another protocols work in case of freeze? SSH, http?
    • Admin
      Admin about 13 years
      @BobC yes can use RDP, ping, PostgreSQL. The mounted SMB file systems have appear to die on the OSX side. Any attempt to access any of the mounted smbfs hangs
    • Admin
      Admin about 13 years
      John McC, how are your Mac clients establishing the mounts initially -- using the Finder, or hand-editing autofs-related files, or using smbclient? Second, for clarification, do you mean there's a period of, say, a day of inactivity between the Mac clients and PC servers, after which there's a dead/stale connection? Third, are the clocks all correct with little skew, say under five minutes?
    • Admin
      Admin about 13 years
      1. mounts are established using finder. 2. I mean that every day or so the SMB (client) stops working. Any attempted use of any SMB network resource (incl other servers) results in a hang. File access, mount, unmount, where through finder or in the shell stop working. I can't see any pattern to it, e.g., length of inactivity. The server shares work fine from other machines. 3. All the machines involved are time sync'd so wouldn't be more than a few seconds apart.
  • Kearney Taaffe
    Kearney Taaffe almost 3 years
    10 years later and this is still happening. If the connection to my Ubuntu server gets lost, I have to restart my computer