Sep 05

Arghhhh!  Apple has done it again.  They’ve changed the manner in which NFS shares are mounted.  Back in 10.5 Leopard, the Directory Utility was used to mount shares.  In 10.6 Snow Leopard the Disk Utility program is the place where this is done.  That wouldn’t have been so bad except for the fact that the upgrade from 10.5 to 10.6 wiped out my NFS mount definitions. Which forced me to learn this new procedure:

Fire up Disk Utility and select File -> NFS Mounts…   Doing so will lead to a very similar dialog as in the 10.5 Directory Utility.  Here’s the list of mounts on my client:

List of NFS Mounts

You can click the “+” to add a new mount. In the following case, I clicked on the pencil to edit an existing mount:

Add NFS Share

I’ve been using the “-P” advanced option to access the shares on our QNAP NAS device. See Mac OS X mount_nfs man page for details.

Adding Shares to Finder

The trick to adding a convenient folder to Finder’s Places folder is to ensure that you create a directory containing the mount points. For example, I defined my mount points under /Volumes/network/.

But you might not see /Volumes and your containment directory when you look at the hard disk in Finder. Use “command-shift-G” to bring up a dialog such that you can go directly to the directory of interest. In my case I went to /Volumes and simply dragged the “network” containment folder over to the Places folder. Voila! Now whenever I want to access my NFS shares, I simple click on the “network” folder in Finder. This is how I had it arranged in 10.5 as well.

As in 10.5, the shares will automatically be mounted as you start your system. The day-to-day experience with this approach was pretty good. Even when our MacBook Pro wasn’t attached to our home network, the machine does not experience any noticeable hangs or hiccups because of the unavailability of the NAS server.

29 Responses to “Access NFS Shares from Mac OS X 10.6 Snow Leopard”

  1. Rob says:

    Hi there, is the NFS mounted QNAP still working fine? Any issues? Would you say it is 100% reliable as a protocol? I am thinking of buying a TS2xx NAS.

    Rob

    • ckamps says:

      Hi Rob, I haven’t had any recent issues with the use of NFS on the TS-109 Pro. There was the original issue where it didn’t work with the QRAID-1 mirroring feature, but that was fixed long ago via a firmware update. Additionally, the use of a TS-1xx unit with two rotated external drives where one is at off-site storage and is swapped with the other one on a monthly basis, has been working like a charm. I purposely avoided a TS-2xx unit because I wanted the combination of almost real-time mirroring and the off-site rotation. I am curious, what’s leading you to the TS-2xx systems?

      BTW, I updated my cost estimate for an up-to-date TS-119-based solution. It includes a eSATA/USB drive dock vs full on external drive enclosures:

  2. Hariharan says:

    I would like to check the ACL properties issues hasbeen solved on Snowleopard. Had anyone tried that. Ex. I have a storage running on Linux, a mac system – both are binded to ADS domain. The shared folders on Storage has the User / Group access given through ADS. The same can be only viewed on MAC – but the relevant user-group-others signatures was not working. Only others signature works. Like of i say full permission “7″ from my Linux system then I can able to access (both R/W) using MAC system. But if I say Read only to others – My MAC wont accept that eventhough User has 7 sign. It was not working for Tiger / Panther & Leopard first releases. After that I never got chance to work on latest release of snowleopards. Would be interested to learn if someone tried or experience the same like me.

    Thanks,
    Hari

    • sykong says:

      I managed to get mine working on 10.5 without ADS. However, on 10.6, I had to give full permission (777) before I could access.

  3. Philipp says:

    I tried to follow this howTo, but I ended up with the problem, that I had no access to the directory /Volumes any more. Also all already mounted AFP-shares in the directory are not accessible any more. Not even as administrator or with sudo in the terminal. I also cannot set the rights because no one has write access to the directory, not even the owner.
    As soon as I unmount the NFS network share, all access rights are correct again and it works as before.
    Any idea what’s wrong or how to solve the problem?

    • ckamps says:

      Hi Philipp, Since we’re not using AFP shares, I haven’t encountered this issue. Have you tried a folder other than Volumes? To confirm, you also created a containment folder under Volumes along with a subdirectory for each mounted share? i.e. you weren’t mounting directly under Volumes, right?

    • ckamps says:

      Hi again,
      Since I was compelled to used an AFP share to configure Time Machine, I ended up using a mix of NFS and AFP to access shares hosted on the QNAP. In doing so, I have not encountered any issues with access to /Volumes. I mount the NFS shares under /Volumes/network and it looks like Time Machine mounts the AFP backup share under /Volumes too.
      Chris

  4. bn says:

    Hi there,
    I do not succeed to set this up.
    I have a qnap-nas server running over the network, nfs service running,
    and I can access my share happily with a linux system

    using

    sudo mount -t nfs xxx.xxx.xxx.xxx:/ShareName nfs ~/mnt/MountPoint

    Howerver, all trials of combinations of values that I have entered into the NFS
    dialogues did not succeed.
    First off,
    if I do not prepend a nfs:// to my IP in the “Remote NFS URL” field, my mac refuses to even enable the
    “Verify” button.

    Next, if I write
    nfs://xxx.xxx.xxx.xxx:/ShareName/
    in the “Remote NFS URL”,
    I can “Verify” the server, and the mount point that I typed under
    “Mount location” is created after hitting the “save” button in the dialogue.
    However, this mount point is created with
    dr-xr-xr-x permissions.
    I am the owner (i. e., not the superuser is the owner), but I cannot change
    the permissions, not even using the superuser.
    I don’t see any way to go to, read from, or write to this directory, my mac always tells me that I do not have the permissions. Not even using the superuser.
    So I don’t seem to be able to set up the nfs connection this way.

    Next, I try it differently:
    Now, I first create the mount point, and then setup the nfs connection exactly
    the way I did it before. Result: I can again verify and save the setup,
    but the share is actually not mounted; whatever I write to my mount point is actually stored on my mac’s harddisk. So no storage was mounted whatsoever.

    Now I am stuck, I don’t know what to do next.
    I don’t know how exactly I am supposed to use the “advanced mount parameters” , very few information is available in the manpages concerning the -P option. I don’t know what I would have to type in the “remote NFS URL”
    field and the “advanced mount parameters” field if I want to access a share that can be accessed using my linux box via

    sudo mount -t nfs xxx.xxx.xxx.xxx:/ShareName ~/mnt/MountPoint

    By the way, the share I try to mount this way nicely appears in the
    Finder in the “Shared” section. I can connect to it and read/write without problems. I would just like to know how to access it via nfs (and ultimately,
    via iscsi).

    Any help appreciated.

  5. bn says:

    Actually, the second colon in the “remote NFS URL” field in above comment is wrong:
    it should be

    nfs://xxx.xxx.xxx.xxx/ShareName/

    otherwise, the “Verify” button does not succeed.

    The linux mount line does contain this colon though.

  6. bn says:

    Ups, and
    the first linux command line is wrong. It should be like the second one:

    sudo mount -t nfs xxx.xxx.xxx.xxx:/ShareName ~/mnt/MountPoint

    sorry for that.

  7. ckamps says:

    Hi bn,

    I updated the blog post with several screenshots and a pointer to the mount_nfs man page where -P is described. I was never able to access a QNAP hosted NFS share without using the -P option.

    BTW, I also spent some time synchronizing my Mac user account UIDs and GIDs to align with the ownership of files on the QNAP. (If you haven’t done so, the trick in the Accounts area of System Preferences is unlock the settings, press the control key and then right-click on the account of interest to see and change the currently assigned user an group IDs).

    Since you have been successful in using Linux and NFS to access your QNAP shares, it sounds like the access permissions on the QNAP side is set up properly.

    Chris

  8. Rui says:

    Hi,

    I followed your guides and I mounted a volume of my QNAP TS-409Pro on my Leopard… but how can I put an alias or something on my desktop so I can quickly access files and folders? I tried to drag to desktop but I keep getting an error saying that I don’t have sufficient privileges to do that…
    Any help appreciated. Thanks

  9. ilium007 says:

    Hi all – great HOWTO – however…. Can anyone shed some more light on mapping UID / GID values to anonid in the /etc/exports file ?? The only way I could get things to work from the OSX side was to have anonuid=1000 and anongid = 1000 in /etc/exports

    Before I did that I could only get RO access on the linux shares. Also, can someone explain no_root_squash ??

    I am not too sure about changing OSX UID’s and GID’s for my user account just to make this work, can I not somehow apply my OSX UID’s and GID’s to the folders I am sharing out from linux via NFS ??

    So confused !!

    • ckamps says:

      I ended up changing the UIDs and GIDs on our Mac OS X accounts to sync them up with the IDs we use on some Linux boxes and we’ve been using for content housed on the NAS. It wasn’t that painful to do on the Mac OS X side, but it helps to have multiple accounts with administrative privilege to do it. On the NAS side, it’s easy to log into the QNAP via ssh with the admin user to do any chowning that is necessary to clean things up. The one thing I haven’t yet done is address cases in which my wife creates a file on the NAS yet the umask is set such that I cannot edit the file.

  10. Alex says:

    What I did under Leopard was edit the /etc/fstab and mount them that way, using the standard Unix synta, since mounting over Directory Utility proved fickle. Has anyone tried this successfully with Snow Leopard? I’m about to upgrade my Mac, but would like to have this issue as clear as possible first since all our shares are NFS.

  11. Tom says:

    Hi. Thanks for the great article. I was wondering about performance of a QNAP TS-459 Pro. It seems that using NFS will give me half the read/write speeds compared to AFP. Is this normal? I am using an Airport Extreme router, and gigabit ethernet. My QNAP is connected only on LAN1. LAN2 is not plugged in…. Might be a bit off-topic, but maybe you can help a beginner :-)

  12. Ryan says:

    So…I have done all this….and can mount the NFS….the read speed is the best I have gotten out of any of the protocols….however when I try to write I get a permissions error….any help…..please….I am a noob to all of this.

  13. Ed says:

    Hi….I just got myself a QNAP TS210 which I am using as a wireless/wired external storage for my Macbook Pro running Mac OSX v 10.6.4. Apologies if this is a simple question but any advice is much appreciated. I’m not using TM but simply finding the QNAP under Finder Shared. When I drag and drop JPEGs over, I can retrieve them and open them. BUT…due to the slow nature of my network, I copied my JPEGs to an external drive and then copied them to the QNAP via USB. When I then tried to open the JPEGs copied via the external drive, I get the message “It may be damaged or use a file format that Preview doesn’t recognize.” Does anyone know what is wrong? Thanks much, Ed

  14. Todd says:

    Thanks for the instructions,

    I have a useable mount. Now, how do I show my full Mac OS 10.6.4 client mount options? The “mount -t nfs” command doesn’t show all the options. I mounted with advanced option proto=udp. I can see the UDP communication in tcpdump output, but not when mount.

    mac_client> sudo mount -t nfs
    snort:/ams/gra on /net/snort/ams/gra (nfs, nodev, nosuid, automounted, nobrowse)

    mac_client> sudo tcpdump -v ‘(host mac_client and host linux_server) and udp’
    13:31… IP (tos 0×0, ttl 64, id 59999, offset 0, flags [none], proto UDP …

    I export a file system from RHEL 5.5 to Mac OS 10.6.4.
    RHEL 5.5 has ‘nfsstat -m’ to show detailed mount information.

  15. Marian says:

    I also have problems writing on the share volume. The mounting is fine, but I only have read access to it.

    Can someone help us here?

    • ckamps says:

      Hi Marian,

      Have you confirmed that filesystem access is allowed for the Unix user ID/group combination that you are using?

      With our Mac OS X and Ubuntu clients accessing the NFS mounted QNAP shares, I’ve had to force the user and group ownership between the clients and the share to be compatible. Essentially, I took the path of standardizing on a set of user and group IDs and using chown and /etc/passwd and /etc/group settings on the QNAP system to force the proper ownership AND under System Preferences on the Mac OS X clients, using the Advanced… settings under Accounts to force the user ID and group of our Mac OS X users to the same values as those set on the QNAP. The latter is tricky in that after making the changes in System Preferences, you also need to do a chown of the user’s area from the command line – all as another administrator user.

      Chris

  16. Ashutosh says:

    Hi, I’m having the same problem with NFS mount. I used both GUI and CLI to mount the NFS on Mac. Mount is successfull but only providing read only access. Mount same share on Linux gives full access.

    Please help me in this regard.

    • ckamps says:

      Have you made sure that the user ID and group ID on the Mac OS X account are aligned with the ownership and permissions of the files on the NAS server?

      In our household I have modified all of our Mac OS X accounts to align with the same Unix accounts as maintained on the NAS server. Same user IDs and group IDs. You can do this on the Mac OS X side using System Preferences -> Accounts. Press “control” key when selecting a user and you will see an “Advanced options…” selection. Once selected, you will see User ID and Group settings. Be careful though: It’s easy to mess up your ability to login. Best to do one account at a time and drop into terminal to perform “chown -R : on all of the content under the targeted /Users/ directory.

  17. john says:

    having probs getting NFS set up for a remote export. the “export” is set up on the remote host to allow my IP. disk utility sees the export when i click “save” button. dir on local is set up on /myusername/NFS, but after reboot on local, when i access the /myusername/NFS there are no files. dunno what i’m doing wrong.

  18. Tech says:

    Disk utility won’t work for me (or a reboot is required). It says OK during the verification, but doesn’t seem to connect. I use a small shell script to connect my SL machine to my QNAP device:

    sudo mount -o resvport,nolocks,locallocks,intr,soft -t nfs storage.mydomain:/Datadisk /private/Documents
    sudo mount -o resvport,nolocks,locallocks,intr,soft -t nfs storage.mydomain:/Multimedia /private/Multimedia

  19. Nick says:

    Hi Chris,

    We are running into issues with speed of SMB shares. Do you think installing the NFS role to our SBS 2011 server would help resolve this issue? Does finder work at good speed against the Q-NAP NAS?

    • ckamps says:

      We’ve been using NFS between our Macs and our QNAP TS-109 for three years or so without any significant browsing issues. Sure, bulk file transfer speeds when copying video files could be a lot better, but I chalk that up to the processor and memory of the relatively old NAS server. Stability of the NFS client across various versions of Mac OS X up through Lion has been quite good – which should be no surprise given the nature of Mac OS X vs Windows in this respect.

      Unlike with the use of SMB, one thing that does need to be addressed when you use NFS is the alignment of user id/group id values between the clients and the NAS server. Whenever we set up a new install of Mac OS X and add our initial set of users, I have to go into the System Preferences -> Users and Groups -> hold down the control key, select a user and select Advanced Options… to manually set the user id/group id settings that match the same account names as used on the NAS server. This can be tricky because you don’t want to mess up your current session. Better to do this for users not logged in. After overriding a user’s user id/group id, then you have to perform a “chown -R : /Users/ to align the file ownership with the recently modified user id/group id.

  20. Gump says:

    Our problem is we want fstab entries that the automounter leaves alone. And that doesn’t seem possible under OS X. If I umount something for whatever reason, I want it to stay unmounted until I decide otherwise — OS X’s automounter just happily keeps mounting.

    And that makes no difference whether it’s in the fstab or not. If I create a network NFS mount under some random location, say /mnt which is not a part of the distrib, the automounter sneaks in and grabs that, too.

    Bad design, IMHO.

Leave a Reply

preload preload preload