Tuesday, October 22, 2013

OS X 10.9 Mavericks Workaround for SMB

Upgrading is never easy.  There is always some new bug introduced as a feature.  That said, you may have noticed that connecting to NAS shares worked perfectly in OS X 10.8.x but doesn't anymore in OS X 10.9 (Mavericks).   Here's the lowdown:

DISCLAIMER:  Though these are pretty harmless changes, any changes you make are at your own risk. 

Issue: 

Clients logging into File Services over SMB with OS X 10.9 experience hanging connection upon login attempt.

Root Cause:

OS X 10.9 now utilizes a new SMB2 stack written by Apple.   Apple's SMB2 implementation is not compatible with many other SMB2 NAS products on the market today while Windows 7, 8, and 8.1 works just fine.   In short, its an Apple bug.

Workaround Option 1:

To force your connection to be SMB1, simply type cifs://servername instead of smb://servername when connecting to a Windows or NAS share.  This is by far easier and requires no real configuration changes.

Workaround Option 2:

To force all connections to be SMB1:
  1. Open A terminal window
  2. paste in the following line followed by the return key(should be all on one line):  
echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "smb_neg=smb1_only" >> ~/Library/Preferences/nsmb.conf

What the command does:
  1. Creates a file called nsmb.conf  in your  home directory at the path ~/Library/Preferences/nsmb.conf.
  2. Adds directives to force SMB connections to use the SMB1 protocol.  This is slower but stable.

How to remove the workaround:
  1. Open a terminal window
  2. paste in the following at the prompt and then hit the return button:
rm ~/Library/Preferences/nsmb.conf

Notes:

Its a good idea to restart your mac before trying to connect to your storage again. This will clear any hung SMB processes from previous attempts to connect to your storage before implementing this workaround.