An .automount unit registers an autofs point: the share isn’t mounted at boot, but the moment a process touches Where=, systemd mounts it on demand. Boots are faster and a dead file server can’t hang startup.
1. The .mount (same as a normal mount)
/etc/systemd/system/mnt-archive.mount:
[Unit]
Description=Archive share
[Mount]
What=nfs-server.internal:/exports/archive
Where=/mnt/archive
Type=nfs
Options=rw,_netdev
Note: no [Install] here — the automount pulls it in.
2. The .automount (same base name)
/etc/systemd/system/mnt-archive.automount:
[Unit]
Description=Automount archive on access
[Automount]
Where=/mnt/archive
TimeoutIdleSec=600
[Install]
WantedBy=multi-user.target
Where=must match the.mountexactly, and the filename must be the escaped path (systemd-escape -p --suffix=automount /mnt/archive).TimeoutIdleSec=600unmounts the share after 10 minutes with no access (omit it to keep it mounted once triggered).
Enable the automount
sudo mkdir -p /mnt/archive
sudo systemctl daemon-reload
sudo systemctl enable --now mnt-archive.automount
# It's NOT mounted yet — touching it triggers the mount:
ls /mnt/archive
findmnt /mnt/archive
Why automount: lazy mounting means a slow or offline NFS/SMB server doesn’t delay boot or block unrelated services, and idle shares free themselves. Gotchas: enable the .automount, never the .mount. The fstab equivalent is the x-systemd.automount mount option, which systemd turns into exactly this pair.