How to Identify automount mount path
I scanned through the change logs for autofs and saw nothing to indicate that the 'dump maps' / automount -m
command was or will be deprecated, so it should pretty much universally work.
It does require root to run; possibly that was an issue? If it is absolutely not working on a particular PC, please provide the version (automount -V) and the OS Type and full version.
You can get the same information - the list of all possible mounts - the way that you said you didn't want to: cat /etc/auto.master
That will provide a rolled up list of monitored spots. To get just the mountpoints (no comments or extraneous info) use grep -vE "^[+#]" /etc/auto.master
To make this painless, set an alias (bash syntax) alias autoMaps='grep -vE "^[+#]" /etc/auto.master
and you'll save yourself the hassled of parsing the output (it strips out everything but the mounts).
This approach would be reasonable (in my opinion) for a straightforward autofs configuration. A complex system with LDAP, multiple master mount points and dozens of other configuration possibilities would make it far less serviceable.
df -a -t autofs
or mount -t autofs
will show you mounted autofs points.
The issue with the /etc/init.d/autofs status
command is due to the now widespread use of systemd instead of init style (e.g. SysV) for initialization / PID 1 / user space bringup.
On systemd systems there is an equivalent command:
systemctl status proc-sys-fs-binfmt_misc.automount
which provides output in this format
● proc-sys-fs-binfmt_misc.automount - Arbitrary Executable File Formats File System Automount Point
Loaded: loaded (/usr/lib/systemd/system/proc-sys-fs-binfmt_misc.automount; static; vendor preset: disabled)
Active: active (running) since Fri 2016-06-10 05:01:07 EDT; 2h 42min ago
Where: /proc/sys/fs/binfmt_misc
Docs: https://www.kernel.org/doc/Documentation/binfmt_misc.txt
http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
That command doesn't exactly jump off the finger tips, but if it something you would run frequently you could setup an alias for it. In bash shell, alias autofsStat='systemctl status proc-sys-fs-binfmt_misc.automount
I think everything you are looking for is there, but has changed slightly. If you have situations / PCs where it definitely doesn't work, please update the question with the specific environment and I can help dig into it. It could be bug, really old version (or both), or potentially a configuration issue.
If I missed the target on this answer, just let me know more specifics about your problems.
Related videos on Youtube
user12345
Updated on September 18, 2022Comments
-
user12345 over 1 year
I need to know all the mount points monitored by
autofs/automount
.I came across "
automount -m
" to dumpmaps and "/etc/init.d/autofs status
" in the older versions. But these commands doesn't work across all the automount versions and not available in all the platforms like Linux, AIX, MAC.So is there any way to get this details without parsing
auto.master/auto_master
. -
user12345 almost 8 years
automount -m
i guess it was introduced around automount version 5. In older version -m switch doesn't exist ( Linux automount version 4.1.3-238). I am looking for a way to fetch automount details across all automount versions and all platforms(Linux, AIX, MAC, solaris,..). I verified the other commands you provideddf -a -t autofs
ormount -t autofs
which are not working in machine where automount version was 5+. Please suggest. -
Argonauts almost 8 yearsThe filtered grep of the config file isn't sufficient? I'll update if i can come up with something better. At the least the service status issue is resolved.
-
user12345 almost 8 yearsAs you explained, filtered grep will not be feasible for Multiple master, indirect maps, LDAP. So that may not scale down.
-
user12345 almost 8 yearsI haven't found any other solution yet, Any luck?
-
user12345 almost 8 yearsIt seems
df -a -t autofs
doesnt work on machines which has automount version 5+. So i am left with no option as of now. -
Mikko Rantalainen almost 4 yearsI would suggest trying
findmnt
orfindmnt -t autofs
with modern kernels.