Mounting can be automated using a mechanism called
automount or autofs.
The /usr/sbin/automount is invoked with the
rc-script /etc/init.d/autofs.
service autofs start
or, on some systems:
/etc/init.d/autofs start
This script reads the configuration file
/etc/auto.master also called a
map. The map file defines mount points to be monitored by individual
automount daemons.
Sample /etc/auto.master
/extra /etc/auto.extra /home /etc/auto.home

When autofs is started it will
invoke an instance of /usr/sbin/automount
for each mount point defined in the master map
/etc/auto.master.
When the map file /etc/auto.master is changed it is
necessary to restart autofs.
For example if mount points have been deleted, then the associated
automount daemon is terminated. Likewise, new daemons
are started for newly defined mount points.
Multiple filesystems can be mounted on a single mount point. These filesystems as well as the mount options needed (filesystem type, read-write permissions, etc) are defined in a separate file.
Sample /etc/auto.extra
cdrom -fstype=iso9660,ro,user,exec,nodev,nosuid :/dev/cdrom nfs -fstype=nfs,soft,intr,rsize=8192,wsize=8 192.168.3.100:/usr/local

The CDROM will automatically be accessible in
/extra/cdrom and the NFS share is mounted as soon as
the /extra/nfs directory is accessed.
![]() | Note |
|---|---|
In the above example:
|