Thursday, 22 October 2009

Creating OS X NFS client mounts (Quiet NAS part 4)

The final stage is to add the mounts for the clients - this script works for OS X (pre-Leopard). This script does the work for us:

# Script:
# Author: Tim Gibon
# Date: 22-Oct-2009
# Description: Remove and create an OS X mount point for pre-Leopard clients.
# Script will error if run more than once. Edit before use.

# Delete old mount from NSLU2 server
nicl . -delete /mounts/datastore:\\/share\\/hdd\\/data\\/communal
# In case we need to run the script multiple times, fresh start the communal share.
nicl . -delete /mounts/datastore:\\/communal
nicl . -create /mounts/datastore:\\/communal
# Set properties of share
nicl . -append /mounts/datastore:\\/communal type nfs
nicl . -append /mounts/datastore:\\/communal dir /Network/communal
nicl . -append /mounts/datastore:\\/communal opts "rw"
# Increase NFS read and write NFS size of client - increases throughput. Optimal size dependant on average file size.
nicl . -append /mounts/datastore:\\/communal opts "rsize=32768"
nicl . -append /mounts/datastore:\\/communal opts "wsize=32768"

# Check that the mount has been correctly added
nicl . -list /mounts

Add an entry for datastore into /etc/hosts if necessary and then restart the automount daemon.

kill -HUP `cat /var/run/`

We can now find the mount under Network->communal

No comments: