Mounting NFS in OSX

https://discussions.apple.com/thread/3698831

Update: for Mountain Lion the NFS mount is taken out. Use LoginHook instead.

Update 2:

sudo vim /etc/mount-allspark
#!/bin/bash
mkdir /Volumes/Allspark
mount -t nfs 192.168.1.10:/media/Allspark /Volumes/Allspark
sudo defaults write com.apple.loginwindow LoginHook /etc/mount-allspark

Update 3: (change mount only if server is reachable, also added resvport and rw option)

#!/bin/bash

HOST=192.168.1.10
ping -c 1 -w 5 $HOST &>/dev/null
if [ $? -ne 0 ] ; then
    echo "down";
else
    mkdir /Volumes/Allspark
    mount -t nfs -o resvport,rw 192.168.1.10:/media/Allspark /Volumes/Allspark
fi

5 thoughts on “Mounting NFS in OSX”

  1. Well this is quite a bummer. I manage 30+ macs at my job and we heavily rely on NFS mounts, and it needs to be mounted before login because we actually mount the home folders from there… I’ll probably end up doing a launchdaemon to mount it as root at startup but I really don’t see why Apple removes features that work….

  2. On network level there are quite a few quirks with the OSX system and it seems to get worse from SL to Lion to ML…

  3. The script does not work on OSX ML v10.8.2. It does not accept the -w option, it should be capital -W
    ping -c 1 -W 5 $HOST &>/dev/null

    and also to add if you want to set the script to run at login:
    sudo defaults write com.apple.loginwindow LoginHook /path/script

Leave a Reply