If x-systemd.automount entries are modified in /etc/fstab, how do I get systemd to reparse the entries?
1 Answer
I could not find clear documentation on how to get systemd to reparse /etc/fstab automounts without rebooting, so:
systemctl daemon-reload
will regenerate the units files in /run/systemd/generator but doesn't start new automounts or stop ones removed from fstab.systemctl start newmount.automount
will start the mount. The .automount extension is required, as systemd assumes .service if not extension is specified.systemctl stop oldmount.automount
will remove a mount not longer in fstabsystemctl reset-failed
will stop a previously failed removed mount from appearing in status messages.
-
1If you are removing a mount that previously failed it will still show up in
systemctl --failed
andsystemctl status oldmount
(with a suspiciousLoaded: not-found (Reason: No such file or directory)
). Asystemctl reset-failed
does the trick in this case.– dreuaJan 26, 2022 at 11:06 -
-
1Note that for adding a new mount point, even after
systemctl daemon-reload
thesystemctl list-units
doesn't show the new mount point, but attempting to runsystemctl start
on the unit (after path mangling /srv/example ->srv-example.automount
) it picks up the new unit. -- Search engine keyword stuffing: systemd automount pick up changes, systemd automount refresh after updating /etc/fstab– hayalciAug 6, 2023 at 16:25 -
I realize the unit was probably inactive and it would have showed in
systemctl list-units --type=automount --all
– hayalciAug 6, 2023 at 16:33