AWS EFS Mount Script Example

This is an example of a bash shell script to mount an AWS Elastic File System (EFS) to an Ubuntu instance.  You can add this to the User Data section when launching new server.

apt-get update
apt-get install -y nfs-common
echo "$(curl -s    /efs/data   nfs4    defaults" >> /etc/fstab
mkdir /efs
chmod go+rw /efs
mkdir /efs/data
chmod go+rw /efs/data
mount -a
Example EFS Mount Script

Replace fs-0000000 on line 5 with your file system ID.

This is just an example.  Use it at your own risk.

Follow by Email

Leave a Reply

Your email address will not be published. Required fields are marked *