How to mount a EFS (Elastic File System) to a Linux Virtual Machine in AWS (Amazon Web Services) - Detailed Step by Step instructions
How to mount a EFS (Elastic File System) to a Linux Virtual Machine in AWS (Amazon Web Services) - Detailed Step by Step instructions
Amazon's EFS - Elastic File System is a storage service that uses Network File System version 4 (NFSv4.1 and NFSv4.0) protocol. The Infrequent Access (IA) storage class is a lower-cost storage class that's designed for storing long-lived, infrequently accessed files cost-effectively.
In this article, I will assume that you are familiar with creating a Ubuntu virtual machine. The instructions in this article would without a problem. On other versions, it should work, but I did not try.
Check the security group attached to your VM, by navigating to EC2 console, clicking Instances in the left navigation menu. Select your VM and check the Description tab, in the bottom pane. Make a note of the security group name, in this article, I will refer to the securitygroup name as 'secgrp'.
Now navigate to the EFS console, click "Create File System", select the VPC if you have multiple VPC's. In the security groups, make sure 'secgrp' is selected. It takes few minutes for the EFS to be created. Now make note of the IP end points, go to 'secgrp', add inbound rules from those IP addresses for NFS i.e port 2049.
Login into your Ubuntu VM using SSH.
Run the following commands:
sudo apt-get update
sudo apt-get install nfs-common
Now, based on the assumption that the file system will be mounted into /home/ubuntu/efs. Navigate to home directory as mentioned below and follow the instructions:
cd ~
mkdir efs
sudo mount -t nfs4 -o nfsvers=4.1, rsize=1048576, wsize=1048576, hard, timeo=600, retrans=2, noresvport <YOUR EFS ADDRESS>:/ efs
Your EFS Mount Address can be found in the EFS console.
Troubleshooting tips:
1) Make sure name is resolvable.
2) Make sure port 2049 from EFS to your EC2 (Inbound) instance is open.
How to mount a EFS (Elastic File System) to a Linux Virtual Machine in AWS (Amazon Web Services) - Detailed Step by Step instructions
Comments
Post a Comment
Chime in!