Skip to content

Create a SystemD service to auto-mount an NFS share on boot by changing (2) variables specifying the NFS version and storage path to the share. PLS NOTE: Pkg install uses apt- folks not using a Debian or derivitive distro need to change lines 85 & 95 to use their own pkg manager

License

Notifications You must be signed in to change notification settings

f1linux/nfs-automount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

VERSIONING & ATTRIBUTION

  • Script Author: Terrence Houlahan, Linux & Network Engineer F1Linux.com

  • Author Site: http://www.F1Linux.com

  • Script Version: 1.00.01

  • Script Date: 20240407

These scripts and others by the author can be found at:

INTRO

This script automates the grunt work of configuring an UBUNTU SystemD host to automount an NFS share.

However, for non-Debian Linux OS', if you replace the package management commands of the script with your particular package management commands it should just work on your own SystemD Linux OS.

INSTRUCTIONS

These are located on the script itself "config-NFS-SystemD-mounts.sh" but generally just change the values of the variables and then execute the script. It will install some NFS packages, create a SystemD mount and finally create the related SystemD service to mount it. Obviously you should have created the NFS share on the storage host in advance of using this script.

iSCSI ?!?!?

Although NFS is suitable for sharing a filesystem across hosts, if you don't want frequent writes trashing your MicroSD card, I have a repo that automates raising an iSCSI volume which avoids direct writes to the local filesystem. I did this for 8GB Raspberry Pi hosts so I could run Docker containers on them:

https://github.com/f1linux/iscsi-automount

Again, different use case, but if you want to run Docker on a Pi and you have a storage appliance that exports LUNs, this is probably what you want.

Apologies

I have an overpriced Mac with a shitty, not-fit-for-purpose keyboard that repeats characters. Vi doesn't spell check, so apologies if the spellling is wrong in places ;-)

About

Create a SystemD service to auto-mount an NFS share on boot by changing (2) variables specifying the NFS version and storage path to the share. PLS NOTE: Pkg install uses apt- folks not using a Debian or derivitive distro need to change lines 85 & 95 to use their own pkg manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages