systemd.automount
nas.example.internal:/srv/export/media /mnt/media nfs defaults,_netdev 0 0
nas.example.internal:/srv/export/media /mnt/media nfs defaults,_netdev 0 0
nas.example.internal:/srv/export/media /mnt/media nfs defaults,_netdev 0 0
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev 0 0
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev 0 0
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev 0 0
x-systemd.automount
systemd.mount(5)
systemd.automount(5)
x-systemd.idle-timeout=
sudo mkdir -p /mnt/media
sudo mkdir -p /mnt/media
sudo mkdir -p /mnt/media
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
nas.example.internal:/srv/export/media /mnt/media nfs noauto,x-systemd.automount,x-systemd.idle-timeout=10min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
x-systemd.automount
x-systemd.idle-timeout=10min
nfsvers=4.2
sudo systemctl daemon-reload
sudo systemctl start mnt-media.automount
sudo systemctl enable mnt-media.automount
sudo systemctl daemon-reload
sudo systemctl start mnt-media.automount
sudo systemctl enable mnt-media.automount
sudo systemctl daemon-reload
sudo systemctl start mnt-media.automount
sudo systemctl enable mnt-media.automount
systemd-escape --path /mnt/media
systemd-escape --path /mnt/media
systemd-escape --path /mnt/media
mnt-media.automount
systemctl status mnt-media.automount --no-pager
systemctl status mnt-media.automount --no-pager
systemctl status mnt-media.automount --no-pager
systemctl list-units --type=automount
systemctl list-units --type=automount
systemctl list-units --type=automount
findmnt /mnt/media
findmnt /mnt/media
findmnt /mnt/media
ls /mnt/media
ls /mnt/media
ls /mnt/media
findmnt /mnt/media
mount | grep ' /mnt/media '
findmnt /mnt/media
mount | grep ' /mnt/media '
findmnt /mnt/media
mount | grep ' /mnt/media '
x-systemd.idle-timeout=10min
systemctl status mnt-media.automount --no-pager
findmnt /mnt/media
systemctl status mnt-media.automount --no-pager
findmnt /mnt/media
systemctl status mnt-media.automount --no-pager
findmnt /mnt/media
After=network-online.target
systemd.automount(5)
x-systemd.automount
systemd.mount(5)
x-systemd.automount
x-systemd.automount
systemd.automount(5)
/mnt/backups
/mnt/projects
systemd.mount(5)
systemd-fstab-generator
x-systemd.automount
nas.example.internal:/srv/export/archive /mnt/archive nfs ro,noauto,x-systemd.automount,x-systemd.idle-timeout=15min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
nas.example.internal:/srv/export/archive /mnt/archive nfs ro,noauto,x-systemd.automount,x-systemd.idle-timeout=15min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
nas.example.internal:/srv/export/archive /mnt/archive nfs ro,noauto,x-systemd.automount,x-systemd.idle-timeout=15min,_netdev,nfsvers=4.2,hard,timeo=600,retrans=2 0 0
sudo mkdir -p /mnt/archive
sudo systemctl daemon-reload
sudo systemctl start mnt-archive.automount
sudo systemctl enable mnt-archive.automount
sudo mkdir -p /mnt/archive
sudo systemctl daemon-reload
sudo systemctl start mnt-archive.automount
sudo systemctl enable mnt-archive.automount
sudo mkdir -p /mnt/archive
sudo systemctl daemon-reload
sudo systemctl start mnt-archive.automount
sudo systemctl enable mnt-archive.automount
x-systemd.automount
systemd.automount(5)
systemd.mount(5)
systemd-fstab-generator(8)
systemd.automount - your system boots more reliably when the server is late or absent
- interactive shells and services stop paying the mount cost until they need the share
- you can add idle unmounts so inactive mounts do not stay pinned forever - home labs with NAS shares
- laptops that sometimes leave the local network
- small servers that consume a remote media or backup share
- hosts where a slow NFS server should not delay boot - x-systemd.automount creates the on-demand automount
- x-systemd.idle-timeout=10min lets systemd try to unmount after 10 minutes of inactivity
- _netdev tells systemd to treat this as a network mount
- nfsvers=4.2 asks for NFSv4.2 and fails if the server does not support it
- hard keeps retrying I/O instead of returning early errors that can corrupt workflows
- timeo=600 and retrans=2 keep the behavior explicit instead of relying on distro defaults - /mnt/backups
- /mnt/projects - the system cannot function without the share
- an application must have the mount available before it starts
- I want failures to surface immediately during boot - the share is convenient, not boot-critical
- the server may be slow, asleep, or temporarily absent
- the host is mobile or changes networks
- I want less boot coupling between machines - systemd.automount(5), Debian manpages: https://manpages.debian.org/testing/systemd/systemd.automount.5.en.html
- systemd.mount(5), Debian manpages: https://manpages.debian.org/testing/systemd/systemd.mount.5.en.html
- systemd-fstab-generator(8), Debian manpages: https://manpages.debian.org/testing/systemd/systemd-fstab-generator.8.en.html
- nfs(5), man7.org: https://man7.org/linux/man-pages/man5/nfs.5.html