Skip to content

Instantly share code, notes, and snippets.

@clcollins
Created April 18, 2016 18:53
Show Gist options
  • Save clcollins/bbe3f6001ce44f5c5266f06812b27efd to your computer and use it in GitHub Desktop.
Save clcollins/bbe3f6001ce44f5c5266f06812b27efd to your computer and use it in GitHub Desktop.
Systemd NFS Automount
#!/bin/sh
systemctl enable <path-to-mountpoint>.automount
systemctl start <path-to-mountpoint>.automount
# Note that the filename must
# match the path to the mount point
# with dashes instead of slashes
[Unit]
Description=NFS Auto Mount
[Automount]
Where=<path-to-mountpoint>
[Install]
WantedBy=multi-user.target
# Note that the filename must
# match the path to the mount point
# with dashes instead of slashes
[Unit]
Description=NFS Mount
[Mount]
What=<nfs-server>:<share>
Where=<path-to-mountpoint>
Type=nfs
Options=nfsvers=3
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment