Mounting a Linux NFS server on Mac OS X 10.6

It looks like in Snow Leopard (OS X 10.6), Apple broke some of the smartiness in NFS mounting from Finder. In 10.5, you could just slap nfs://host/path into Finder's "Connect to Server" dialog and it would happily mount just fine. In 10.6, it doesn't and here's what you get...

On the server, a mountd success message is the only indication that it received communication:

Oct  5 09:15:59 nfsserver mountd[5551]: authenticated mount request from 1.2.3.4:1015 for /nfsshare (/nfsshare)

On the client, the dialog box will briefly show the progress bar and then revert back to the "Connect to Server" input box. When mounting on the command-line, you'll get:

bash-3.2# mount_nfs nfsserver:/nfsshare /nfsmount
mount_nfs: /nfsmount: Operation not permitted

The disconnect is that Linux by default expects "secure" ports to be used for NFS. Mac OS X on the other hand defaults now to "insecure" ports. The secret sauce to get it to mount via mount_nfs is to specify the resvport mount option on the command-line or the better option of telling Linux to allow insecure ports for NFS communication in /etc/exports. Doing the latter will allow you to mount via the "Connect to Server" dialog or on the command-line.

If you just want to mount a Linux NFS mount (that by default does not allow "insecure" ports), use this on the Mac OS X command-line:

mount_nfs -o resvport nfsserver:/nfsshare /nfsmount

If you want to allow Mac OS X to mount Linux NFS mounts on the server, make sure your export line contains insecure. Here's an example line in /etc/exports:

/nfsshare          1.2.3.5(ro,async,no_root_squash,no_subtree_check,insecure)

Linux enforces an idealistic multi-user machine view of the old world. This concept of defining "insecure" and "secure" based on privileged port numbers is antiquated and doesn't apply in a world where everyone has ultimate privileges on their desktop machines.

posted by Matt | 10/05/10 | 10:15:49 am | 28649 views | Hastily filed in Gentoo, Mac OS X
PermalinkPermalink  

0101010101001010101110101010101011100101010101010100111000111010101011100001010101010101101101010111000110101011001011110101010100101000111010101001110101010101010111101010111011010101001001111011011010011011111010111101001011011101010001110010101010100011110101010101111010101100010010101

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

2 comments

Comment from: Guille [Visitor]
GuilleThank you very much. New to mac, comming from linux, and needing this!
10/08/11 @ 21:02
Comment from: egregious [Visitor]
egregiousThis is super easy in Lion in case anyone wants to know:

From disk utility: File->NFS mounts

Add a newmount and you're good to go. Includes automount, too!
06/25/12 @ 15:41

This post has 937 feedbacks awaiting moderation...


bottom corner

An unexpected error has occurred!

If this error persists, please report it to the administrator.

Go back to home page

Additional information about this error:

MySQL error!

Table './blogaristoo/evo_hitlog' is marked as crashed and should be repaired(Errno=145)

Your query: Record the hit

INSERT INTO evo_hitlog(
        hit_sess_ID, hit_datetime, hit_uri, hit_referer_type,
        hit_referer, hit_referer_dom_ID, hit_keyphrase_keyp_ID, hit_serprank, hit_blog_ID, hit_remote_addr, hit_agent_type )
      VALUES( '847990', FROM_UNIXTIME(1369376629), '/index.php/mounting-a-linux-nfs-server-on-mac-os-x-10-6', 'direct', '', NULL, NULL, NULL, 2, '50.16.17.90', 'unknown'
      )

An unexpected error has occurred!

If this error persists, please report it to the administrator.

Go back to home page

Additional information about this error:

MySQL error!

Table './blogaristoo/evo_hitlog' is marked as crashed and should be repaired(Errno=145)

Your query: Hit: Check for reload

SELECT SQL_NO_CACHE hit_ID
  FROM evo_hitlog
 WHERE hit_datetime > '2013-05-24 02:18:49'
   AND hit_remote_addr = '50.16.17.90'
   AND hit_uri = '/index.php/mounting-a-linux-nfs-server-on-mac-os-x-10-6'
   AND hit_agent_type = 'unknown'
 LIMIT 1