Mounting shared folders in Mac OS X Leopard
Wednesday, 12th November, 2008Having recently switched to Mac OS X, I stumbled upon issues when mounting shared folders on my Macbook Pro from our Linux development server. Previously, both Windows Vista and Ubuntu have had no trouble sharing a directory then mounting it from the dev server via smbfs. This enables me (and other developers) to edit files locally which then also appear as a local files to our development server, where we run Apache / MySQL etc.
After sniffing around System Preferences in Leopard, and juggling some account credentials so SMB login details pair up, I could successfully mount my workspace folder. Make sure the appropriate permissions are set on your shared folder, then click options and disable AFP, and enable SMB.

Unfortunately, some minutes later it unmounted itself. After some Googling, I found others with the same issue.
I read (unfortunately I’ve since lost the link) that changing from smbfs to cifs helps remedy this problem. I gave it a shot and it sure enough it cured the dropping issue.
However, when using cifs I would get permissions problems if I ran a script that manipulated / generated files in my workspace. My OS X uid and gid do not match those of the development server (Ubuntu); Mac uids start at 501 and Ubuntu creates users starting above 1000.
Fortunately simply telling the mount to ignore permissions seem to solve the problem. This is the mount entry in the development server’s /etc/fstab:
//192.168.0.1/workspace /home/greg/workspace cifs
noperm,credentials=/home/greg/workspace.smb,rw 0 0
That should be all on one line but is broken over two for formatting purposes. Of course you substitute 192.168.0.1 with your Macbook’s UNC name or IP address. You should substitute ‘workspace’ with the name of your shared folder and change the mount point on the local server accordingly too.
The username and password specified in your credentials file will have to match your OS X user and password you set up when modifying the sharing options earlier.



