Auto Mounting a Single Directory at the Root of the Filesystem with Autofs

Tags: , , , , , , , , , , ,

Recently I wanted to ensure that /pub on my server automatically mounted an NFS export using autofs. As it turns out this is very easy to do, but took me some research to figure out how autofs handles this use case.

Autofs refers to a single mount point as a “direct map”. Direct maps look something like this:

/-	/etc/
/pub        -fstype=nfs   

After an autofs restart, is auto mounted on /pub when used.