From Surf Wiki (app.surf) — the open knowledge base
Automounter
Software that automatically mounts filesystems
Software that automatically mounts filesystems
An automounter is any program or software facility which automatically mounts filesystems in response to access operations by user programs. An automounter system utility (daemon under Unix), when notified of file and directory access attempts under selectively monitored subdirectory trees, dynamically and transparently makes local or remote devices accessible.
The automounter has the purpose of conserving local system resources and of reducing the coupling between systems which share filesystems with a number of servers. For example, a large to mid-sized organization might have hundreds of file servers and thousands of workstations or other nodes accessing files from any number of those servers at any time. Usually, only a relatively small number of remote filesystems (exports) will be active on any given node at any given time. Deferring the mounting of such a filesystem until a process actually needs to access it reduces the need to track such mounts, increasing reliability, flexibility and performance.
Frequently, one or more fileservers will become inaccessible (down for maintenance, on a remote and temporarily disconnected network, or accessed via a congested link). Administrators also often find it necessary to relocate data from one file server to another - to resolve capacity issues and balance the load. Having data mount-points automated makes it easier to reconfigure client systems in such cases.
These factors combine to pose challenges to older "static" management methods of filesystem mount tables (the fstab files on Unix systems). Automounter utilities address these challenges and allow sysadmins to consolidate and centralize the associations of mountpoints (directory names) to the exports. When done properly, users can transparently access files and directories as if all of their workstations and other nodes attach to a single enterprise-wide filesystem.
One can also use automounters to define multiple repositories for read-only data; client systems can automatically choose which repository to mount based on availability, file-server load, or proximity on the network.
Home directories
Multiple establishments will have a number of file servers which host the home directories of various users. All workstations and other nodes internal to such organizations (typically all those behind a common firewall separating them from the Internet) will be configured with automounter services so that any user logging into any node implicitly triggers access to his or her own home directory which, consequently, is mounted at a common mountpoint, such as /home/*user*. This allows users to access their own files from anywhere in the enterprise, which is useful in UNIX environments, where users may frequently invoke commands on a number of remote systems via various job-dispatching commands such as ssh, telnet, rsh or rlogin, or via the X11 or VNC protocols.
/net
A very common default automounter local path is of the form
/net/*hostname*/*nfspath*
where *hostname* is the host name of the remote machine and *nfspath* is the path that is exported over NFS on the remote machine. This notation generally frees the system manager from having to manage each exported path explicitly via a central automounter map. This feature was disabled by default in macOS after it was discovered that it allows Gatekeeper to be bypassed.
Software
Tom Lyon developed the original automount software at Sun Microsystems: SunOS 4.0 made automounting available in 1988. Sun Microsystems eventually licensed this implementation to other commercial UNIX distributions. Solaris 2.0, first released in 1992, implemented its automounter with a synthetic file system called autofs, which communicates with a user-mode daemon that performs mounts. Other Unix-like systems have adopted that implementation of the automounter - including AIX, HP-UX, and Mac OS X 10.5 and later.
In December 1989 Jan-Simon Pendry released Amd, an automounter "based in spirit" on the SunOS automount program. Amd has also become known as the Berkeley Automounter.
Linux has an independent implementation of an autofs-based automounter; version 5 of that automounter generally operates compatibly with the Solaris automounter.
FreeBSD used to provide Amd; starting with 10.1 it has a new automounter very similar to the Solaris one. It has been subsequently ported to DragonFly BSD{{cite mailing list | mailing-list=commits@dragonflybsd.org | access-date=2019-11-13}} and NetBSD.
Some operating systems also support automatic mounting of external drives (such as disk drives or flash drives that use FireWire or USB connections) and removable media (such as CDs and DVDs). This technology differs from the automounting described here; it involves mounting local media when the user attaches them to or inserts them into the system, rather than mounting directories from remote file servers when a reference is made to them. Linux currently (as of Linux 2.6) uses the user-space program udev for this form of automounting. Some automounting functions have been implemented in the separate program HAL, but are being merged into udev. OpenBSD has hotplugd(8) which triggers special scripts on attach or detach of removable devices, so that user can easily add mounting of removable drives. In macOS, diskarbitrationd carries out this form of automatic mounting. In FreeBSD, the removable media can be handled by the automounter, just as network shares are.
Disadvantages and caveats
While automounter utilities (and remote filesystems in general) can provide centrally managed, consistent and largely transparent access to an organization's storage services, they also can have their downsides:
- Access to automounted directories can trigger delays while the automounter resolves the mapping and mounts the export into place.
- Timeouts can cause the unmounting of mounted directories (which situation can later result in mount delays upon the next attempted access).
- The mapping of mountpoint to export arguments is usually done via some directory service such as LDAP or NIS, which constitutes another dependency (potential point of failure).
- When some systems require frequent access to some resources, while others only need occasional access, this can cause difficult or impossible problems in implementing a consistent, enterprise-wide mixture of locally "mirrored" (replicated) and automounted directories.
- When data is migrated from one file server (export) to another, there can be an indeterminate number of systems which, for various reasons, still have an active mount on the old location ("stale NFS mounts"); these can cause issues which may even require the reboot of otherwise perfectly stable hosts.
- Organizations can find that they've created a "spaghetti" of mappings which can entail considerable management overhead and sometimes quite a bit of confusion among users and administrators.
- Users can become so accustomed to the transparency of automounted resources that they neglect to consider some of the differences in access semantics that may apply to networked filesystems, as compared to locally mounted devices. In particular, programmers may attempt to use "locking" techniques which are safe and provide the desired atomicity guarantees on local filesystems, but which are documented as inherently vulnerable to race conditions when used on NFS.
References
References
- Filippo Cavallarin. (24 May 2019). "MacOS X GateKeeper Bypass".
- Callaghan, Brent. (2000). "NFS Illustrated". [[Addison-Wesley]].
- (June 21–25, 1993). "The Autofs Automounter".
- Labiaga, Ricardo. (November 7–12, 1999). "Enhancements to the Autofs Automounter".
- Jan-Simon Pendry. (1989-12-01). "
''Amd'' - An Automounter". - Edward Tomasz Napierała. (2014-07-30). "Autofs".
- "New automounter".
- "FreeBSD Handbook, section 17.4.2. Automounting Removable Media".
- Dickison, Anne. (2015-03-13). "FreeBSD From the Trenches: Using autofs(5) to Mount Removable Media". [[FreeBSD Foundation]].
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Automounter — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report