Mounting an NFS share on OS X has always been slightly more troublesome when compared to mounting an NFS share on a Linux distribution.
For example, I have a Fedora box exporting an NFS share that I want to mount on OS X Mountain Lion. Two of the ways to mount an NFS share on OS X are via the Finder or via the command line.
To mount the NFS share from Finder, open Finder, select Go in the menu bar, select Connect to Server… in the dropdown menu, and type nfs://192.168.0.100:/mnt/raid1/media in the Server Address: field. But, this results in a generic error.
To mount the NFS share from the command line, open Terminal and mount the same NFS share by running sudo mount_nfs 192.168.0.100:/mnt/raid1/media /Volumes/media
(assume /Volumes/media already exists). But, this results in the following error:
192.168.0.100:/mnt/raid1/media Operation not permitted
Fix the Finder Error
Thanks to RJVB’s comment, to fix the Finder error, you simply need to add the server-side complement of -o resvport
to the NFS server’s exports file. What follows is a copy of that comment:
If you want to be able to mount the shares via the Finder’s mount dialog, you can add the server-side complement of -o resvport to the server’s /etc/exports file: add “insecure” to the share options. For instance:
/mnt/raid1/media 192.168.0.0/16(rw,insecure)
Fix the Command Line Error
Thanks to Jose Manuel’s post, simply adding -o resvport
to the mount_nfs
command resolves the above command line error and successfully mounts the NFS share.
sudo mount_nfs -o resvport 192.168.0.100:/mnt/raid1/media /Volumes/media
Also read Jose Manuel’s post for additional NFS parameters to achieve better NFS performance.