How do I attach an NFS volume to my Spinup server?
Prerequisites
You need a Linux server (mounting NFS volumes on Windows is not currently supported)
You need to have at least one NFS volume created and located in the same space as your server
Note: If you don’t know how to create an NFS volume or want to learn more about the NFS offering in Spinup please see https://yaleits.atlassian.net/wiki/spaces/spinup/pages/1862991893
Additional performance tips can be found here: Amazon EFS Performance Tips.
Procedure
The first time you will need to download and run this script to install amazon-efs-utils on your server. This is required to easily mount an NFS volume with encryption. The script will install all required pre-requisites depending on your specific Linux distro. Wait until it finishes running:
curl https://raw.githubusercontent.com/YaleSpinup/utils-storage/master/amazon-efs-utils/install_efs_utils.sh -o install_efs_utils.sh && \ chmod 755 install_efs_utils.sh && \ sudo ./install_efs_utils.sh
You can run the script again to confirm amazon-efs-utils is installed, e.g.
$ sudo ./install_efs_utils.sh Detected OS: CentOS Linux 7 (Core) amazon-efs-utils already installed stunnel already installed stunnel 5.57 on x86_64-pc-linux-gnu platform No need to patch stunnel, version 5.57 already installed
If you run into issues or errors when running the script, you can contact spinup@yale.edu for support
Determine the File System id of your NFS volume (from the Spinup web interface) - in this case it’s
fs-d08e6d24
- you’ll need that to mount the volume
Mount the volume using the file system id - in this case we’ll mount it on
/mnt
- make sure you use thetls
option to enable encryptionsudo mount -t efs -o tls fs-d08e6d24:/ /mnt
Confirm that you see the volume, e.g.
Keep in mind the size of the volume is unlimited, so you can store any amount of data on it and you will only be charged based on your average usage
To mount the volume persistently so it shows up after a reboot, add an entry to your
/etc/fstab
file (make sure you replacefs-d08e6d24
with your id and/mnt
with your mount point):Test that the fstab works:
If you see any errors above or the volume is not mounted properly, you will need to edit your
/etc/fstab
and fix any issues before rebooting your server! Errors in your fstab file may render your server unusable after a reboot.