1984 – the techblog

(Hopefully) useful various sysadmin and other stuff.

fstab gone in Mac OS X — How to add mounts.

Recently, I had to add a mount entry to a rel­a­tively new Mac OS X Server instal­la­tion (Snow Leop­ard). As you may have noticed, the /etc/fstab file is gone. There is a /etc/fstab.hd, but it con­tains a stern warn­ing not to use it. Err…but where does one note mounts with­out this file? Reg­u­lar, directly attached devices are no prob­lem (OS X will search and attach them auto­mat­i­cally) but how’s it going with net­work mounts?

As Dar­win is grad­u­ally mov­ing sys­tem set­tings away from sin­gle files, the answer lies in Direc­tory Ser­vice. Once you get to know it, it’s quite a neat thing. For now, it suf­fices to know that it uses a directory-based, Node, Key-And-Value design approach to rep­re­sent set­tings, user infor­ma­tion and many more things.

System-local set­tings 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 cre­ate empty nodes) in order to get the mount working:

dscl . -create '/Mounts/HOSTNAME:PATH' VFSType nfs

To tell the sys­tem where to mount the filesys­tem, 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 filesys­tems pos­si­ble, and with the key VFSOpts one can set mount options.

Leave a Reply