fstab gone in Mac OS X — How to add mounts.
Recently, I had to add a mount entry to a relatively new Mac OS X Server installation (Snow Leopard). As you may have noticed, the /etc/fstab file is gone. There is a /etc/fstab.hd, but it contains a stern warning notÂ to use it. Err…but where does one note mounts without this file? Regular, directly attached devices are no problem (OS X will search and attach them automatically) but how’s it going with network mounts?
As Darwin is gradually moving system settings away from single files, the answer lies in Directory Service. Once you get to know it, it’s quite a neat thing. For now, it suffices to know that it uses a directory-based, Node, Key-And-Value design approach to represent settings, user information and many more things.
System-local settings are stored below the node /Local/Default. There, a Node “Mounts” exists. That’s where we’re going to add a new node (and an entry, since AFAIR you can’t create empty nodes) in order to get the mount working:
dscl . -create '/Mounts/HOSTNAME:PATH' VFSType nfs
To tell the system whereÂ to mount the filesystem, a new entry has to appended to the node created:
dscl . -append '/Mounts/HOSTNAME:PATH'Â VFSLinkDir /net/local/mount/point
And that’s it. At least, for NFS mounts, there are other filesystems possible, and with the key
VFSOpts one can set mount options.