FreeBSD: NFS automount with AutoFS


This applies only to FreeBSD 10.1 and newer. Previous FreeBSD releases must use amd.

Personally, I dislike ‘amd’. Its configuration is a bit complex. Autofs configuration is pretty simple.

I want to automount 2 folders from my ReadyNas Duo:

192.168.0.14:/media
192.168.0.14:/backup

First, enable autofs:

/etc/rc.conf:

#AUTOFS
autofs_enable=”YES”

Next, edit /etc/auto_master pointing to the map file with the folders to automount:

/etc/auto_master:

#NFS
/mnt/nas        /etc/auto.nas

Take note ‘/mnt/nas’ is the point where the folders will be mounted.

Then create a file with the map:

/etc/auto.nas:

media -intr,nfsv3 192.168.0.14:/media
backup -intr,nfsv3 192.168.0.14:/backup

Finally start autofs:

service start automount

service start automountd

service start autounmountd

In a terminal or file browser go to /mnt/nas/media and /mnt/nas/backup to check if autofs works.

About jjjesss

I'm a guy interested in technology, bsd fan and concerned about the world around.
This entry was posted in BSD, FreeBSD. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s