Autofs vs systemd automount

I’m used to using automount, and it’s reinforced by the fact that I use it in my job.

Just curious to know which one you prefer, and if there’s performance benefit of one over the other?

1 Like

I’ve been using autofs for years.

systemd is ever increasing their ecosystem of services. I am getting used to some aspects and try to keep up, but at this point I find autofs simpler to use.

Both services just mount file systems automatically. There should not be any performance benefits for file transfers as the same code is used in both cases.
Any possible performance differences in performing mounts are not relevant to me.

I seem to recall that with CentOS-8 if an autofs mount was recently used (still mounted) when shutting down, it would stall for quite a while (probably because the VPN was disconnected before the file system was unmounted). I haven’t tested, does anyone know if automount is smarter/better in this regard?

I don’t think I can state anything on performance, but I’d have to say I found systemd-automount sufficiently inconsistent I effected a script to manually toggle remote mounts instead. even if I have to assume misconfiguration, that shouldn’t have been the easier answer.

In fairness after some tuning on parameters it now more consistently suits my use cases better (flaky cellular and vpn’s, or, say changing between eth and wifi)

fstab options:

x-systemd.automount,
x-systemd.mount-timeout=10,
x-systemd.idle-timeout=30

(I hesitate to list all fstab options, reading all of them on stackexchange actually was less helpful, to me than critically reading man 5 systemd.mount and picking values that would always expire before my keyboard became in danger)

I also use another script, to automatically install & enable a oneshot unit to unlink all the remote fs before entering a shutdown state.

I’d imagine the exact same idea could occur with autofs.