6

If x-systemd.automount entries are modified in /etc/fstab, how do I get systemd to reparse the entries?

1 Answer 1

7

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 fstab
  • systemctl reset-failed will stop a previously failed removed mount from appearing in status messages.
4
  • 1
    If you are removing a mount that previously failed it will still show up in systemctl --failed and systemctl status oldmount (with a suspicious Loaded: not-found (Reason: No such file or directory)). A systemctl reset-failed does the trick in this case.
    – dreua
    Jan 26, 2022 at 11:06
  • @dreua, good info, added to answer.
    – gerard
    Jan 26, 2022 at 20:26
  • 1
    Note that for adding a new mount point, even after systemctl daemon-reload the systemctl list-units doesn't show the new mount point, but attempting to run systemctl 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
    – hayalci
    Aug 6, 2023 at 16:25
  • I realize the unit was probably inactive and it would have showed in systemctl list-units --type=automount --all
    – hayalci
    Aug 6, 2023 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .