Filesystem Administration  «Prev  Next»

Lesson 5 Setting up the automounter
Objective Set up the automounter.

Setting up Automounter in Red Hat

amd vs. autofs

The two Linux automounters that can be configured and used on the Red Hat Linux system are:
  1. autofs
  2. systemd.automount

amd is not an automounter, but a package manager for AMD64 systems.
autofs is the traditional automounter for Linux. It has been around for many years and is very powerful and flexible. However, it can be complex to configure.
systemd.automount is a newer automounter that is integrated with the systemd system and service manager. It is simpler to configure than autofs, but it is not as powerful. Which automounter you choose depends on your needs and preferences. If you need a powerful and flexible automounter, autofs is a good choice. If you need a simpler and easier-to-configure automounter, systemd.automount is a good choice.
Here is a table comparing the two automounters:
Feature autofs systemd.automount
Maturity Mature Newer
Power and flexibility Powerful and flexible Less powerful and flexible
Complexity Complex to configure Simpler to configure
Integration with systemd Not integrated Integrated
There are two Linux automounters that can be configured and used on the Linux system:

Automounters in Red Hat Linux

Automounting is a mechanism that provides automatic mounting and unmounting of filesystems, typically upon access or after a specified period of inactivity. On Red Hat Linux systems, two predominant automounters can be configured and utilized: `autofs` and `amd`.

1. autofs

  1. Description: `autofs` is the default automount daemon used in Red Hat Linux and its derivatives. It uses kernel-based automounting facilities and manages the automatic mounting and unmounting of filesystems defined in its configuration.
  2. Configuration File: The main configuration file for `autofs` is `/etc/auto.master`. Secondary or map files, often named `/etc/auto.*`, are specified within this main file. These map files define specific mount points and their associated sources.
  3. Service Management:
    1. Starting: `systemctl start autofs`
    2. Stopping: `systemctl stop autofs`
    3. Enabling on Boot: `systemctl enable autofs`
  4. Key Features:
    1. Supports a variety of map sources, including local files, NIS, and LDAP.
    2. Can mount NFS, CIFS, and other network and local filesystems.
    3. Provides timeout-based unmounting to free resources when not in use.

2. amd (Automounter Daemon)

  1. Description: `amd` is an alternative automounter that predates `autofs`. While less commonly used today in Red Hat environments than `autofs`, `amd` remains a viable choice for certain scenarios, especially in environments with legacy configurations or specific needs.
  2. Configuration File: The primary configuration file for `amd` is `/etc/amd.conf`. Mount maps are defined in separate map files referenced from the main configuration.
  3. Service Management:
    1. Starting: `systemctl start amd`
    2. Stopping: `systemctl stop amd`
    3. Enabling on Boot: `systemctl enable amd`
  4. Key Features:
    1. Provides advanced features like caching and replication.
    2. Supports hierarchical mounts.
    3. Possesses a more complex configuration than `autofs`, but offers finer control in some aspects.
Both `autofs` and `amd` offer robust solutions for automounting needs on Red Hat Linux. While `autofs` is more commonly employed due to its simplicity and integration into modern Red Hat systems, `amd` remains a powerful tool, especially for specialized use cases. Administrators should assess their specific requirements to determine the best choice for their environment.
amd and autofs.
amd is user-level and requires no kernel support; autofs requires kernel support, but is simpler to administer. autofs kernel support is built into the stock kernel installed by the Red Hat Linux distribution. However, the autofs RPM must be installed and local configuration may be required. map file definition: "in automounter parlance, a configuration file that associates a directory key with a device to mount when that directory key is accessed." autofs has a master configuration file and a second type of configuration file, a map file for each autofs filesystem mount point.

autofs master file | Entry in /etc/auto.master

The master configuration file /etc/auto.master contains the overall automount configuration, illustrated in the following diagram.

automatster over
Detailed information regarding the master configuration file is displayed below.

This is the mount point, the location where the autofs filesystem associated with map will be mounted
1) This is the mount point, the location where the autofs filesystem associated with map will be mounted on the local filesystem, in this case ./misc

The map file contains entries for the devices to be mounted on the mount point
2) This is the map file associated with the autofs filesystem.
The map file contains entries for the devices to be mounted on the mount point

In this case, all devices listed in /etc/auto.misc automatically will be unmounted after 60 seconds of disuse.
3) These are options associated with all the devices listed in the map file.
In this case, all devices listed in /etc/auto.misc automatically will be unmounted after 60 seconds of disuse


autofs map file

The map file /etc/auto.misc has entries such as the following:
1) cd, 2) floppy, 3) -fstype=iso9660,ro, 4) -fstype=auto, 5) :/dev/cdrom. 6) :/dev/fd0
1) cd, 2) floppy, 3) -fstype=iso9660,ro, 4) -fstype=auto, 5) :/dev/cdrom. 6) :/dev/fd0

Mount Point Access

Other options

/etc/rc.d/init.d/autofs status will report the status and location of all automounter active mount points. Other options that can be used with autofs include start, stop, and reload, which perform the obvious actions. For example, /etc/rc.d/init.d/autofs stop will stop the automounter and deactivate any currently active automatic mount points.
If you make changes to the automounter, you should reboot to verify that it comes up. If it fails, you should make autofs automatically run with the command chkconfig, add autofs. The following simulation walks you through the process of setting up the automounter.
Perform Redhat Automounter Steps
The next lesson describes network file synchronization.

SettingUp Automounter


The following paragraph checks your understanding of how to set up the automounter.

Setting up automounter

This exercise asked you to simulate the process required to install and configure the automounter to automount your CD-ROM and make it accessible at
/local_cd
. The following screen illustrates the results.

File systems
  1. Kernel automounter version 4 support (also supports v3) N
  2. Ext3 journalling file system support

Simulation result
Simulation result