Setup OpenBSD as an NFS Server
First setup NFS on the server as described here.
Enable NFS in /etc/rc.conf.local
.
lockd="YES"
portmap_flags="YES"
mountd_flags="-n"
nfsd_flags="-t -u -n4"
You may check rpc by issuing the following on the client machine.
rpcinfo -p <server>
Add the following to /etc/exports
.
/home/share -network=192.168.0 -mask=255.255.255.0
This means that all users that mount any mount point under /home (e.g. /home/share) will be mapped to user nfs
and thus be given the same permissions as user nfs
. Only a singe user mapping is possible for each sever local mount point. I have however not verified if this works for different local mount points.
To get diversified user permissions to work over NFS it is required that UID and GID is the same on all machines (the client uid, gui is used) which is unrealistic in many systems. In this situation the -mapall
directive should be left out. See NIS and LDAP may be used distribute user accounts over a network.
Reload exports data. Note that removal of mount point needs reboot it seems!
pkill -HUP mountd
Reboot or start NFS manually as described in OpenBSD FAQ.
Try to mount from another OpenBSD machine.
mkdir /mnt/nfs
mount -t nfs 192.168.0.4:/home/share /mnt/nfs
Mount volume from MacOS Leopard e.g. using the Directory Utility. Follow the guide, NFS in Mac OS 10.5 Leopard
post.
Make sure to set -P
option ("use a privileged port" i.e. a port lower than 1024) otherwise the mount will not work properly (mountd may be run to accept unpriveledged ports).
mkdir /Volumes/library_share
sudo mount_nfs -P library:/home/share /Volumes/library_share
df -h /Volumes/library_share
umount /Volumes/library_share
Start Directory Utility
and add the volume using the -P option under Advanced Mount Parameters
.
Other gotchas
- GID of touched files inherit from the parent folder.
Setup MacOS Time Machine for NFS
This does not work in 10.5.7 !!
See tip here.
The only thing is to enable "unsupported" network storage for Time Machine.
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Then change network drive as described in guide above.
See AFSSetup for more information on setting up OpenBSD as a AFS (Apple File Sharing) server which does have Time Machine support.
References
- NFS: Overview and Gotchas
- Using automount on Mac OS X
- NFS in Mac OS 10.5 Leopard
post - Mac OS X Leopard as NFS Client
- Ubuntu Time Machine NAS
- NFS server on OpenBSD, client on Mac OS X