Mount Elastic File System (EFS) On EC2
Mount Elastic File System (EFS) On EC2
Home / AWS / Guided Lab / Mount Elastic File System (EFS) on EC2
e 0h 59m 4s left
End Lab
Open Console
Validation
Lab Credentials
User Name x
Whiz_User_16857.12847163 w
Password x
26aeb114-3d18-4ec0-91c2-d96612cd28bf w
Access Key x
AKIAR7S7OT3L5INPG4GU w
Secret Key x
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 w
Lab Resources
Support Documents
Privacy - Terms
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 1/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
Need help?
Troubleshooting Lab
FAQs
Storage
Lab Steps
Task 1: Sign in to AWS Management Console
1. Click on the Open Console button, and you will get redirected to AWS Console in a
new browser tab.
Now copy your User Name and Password in the Lab Console to the IAM
Username and Password in AWS Console and click on the Sign in button.
3. Once Signed In to the AWS Management Console, Make the default AWS Region as US
East (N. Virginia) us-east-1.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 2/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
Note : If you face any issues, please go through FAQs and Troubleshooting for Labs.
2. Navigate to the Services menu in the top, then click on EC2 in the Compute section.
3. Click on Instances from the left side bar and then click on Launch instances.
6. For Amazon Machine Image (AMI): Search for Amazon Linux 2 AMI in the search box
and click on the Select button.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 3/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
To add SSH:
Source: Anywhere
For NFS:
Source: Anywhere
11. Keep Rest thing Default and Click on Launch Instance Button.
13. Launch Status: Your instance is now launching. Click on the instance ID and wait until
the initialization status changes to Running.
14. Click on each instance and enter a names as MyEC2-1 and MyEC2-2.
15. Take note of the IPv4 Public IP Addresses of the EC2 instances and save them for later.
1. Navigate to EFS by clicking on the Services menu at the top. Click on EFS in
the Storage section.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 4/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
4. Enter the details below, Type the Name as EFS-Demo and make
sure default VPC and default Regional options are selected.
6. Leave everything by default and click on the Next button present below.
7. Network Access:
VPC
An Amazon EFS file system is accessed by EC2 instances running inside one
of your VPCs.
Choose the same VPC you selected while launching the EC2 instance (leave
as default).
Mount Targets
We will select all the Availability Zones (AZ’s) so that the EC2 instances
across your VPC can access the file system.
Select all the Availability Zones, and in the Security Groups, select EFS
Security Group instead of the default value.
Make sure you remove the default security group and select the EFS Security
Group, otherwise you will get an error in further steps.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 5/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
8. File system policy - optional let it be optional only. Click on Next button
9. Review and Create: Review the configuration below before proceeding to create
your file system. Click on Create button.
10. Congratulations on creating the EFS File system, It's time to mount your EC2 Instance
with the EFS File system.
1. Select the MyEC2-1 Instance and copy the IPv4 Public IP.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 6/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
sudo -s
w
4. Run the updates using the following command:
yum -y update
w
5. Install the NFS client as amazon-efs-utils.
mkdir efs
w
7. We have to mount the file system in this directory.
8. To do so, navigate to the AWS console and click on the created file system. On the
top-right corner, click on Attach
9. To display information for all currently-mounted file systems, we'll use the command
bellow:
df -h
w
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 7/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
mkdir aws
w
1. Select the MyEC2-2 Instance and copy the IPv4 Public IP.
sudo -s
w
4. Run the updates using the following command:
yum -y update
w
5. Install the NFS client as amazon-efs-utils.
mkdir efs
w
7. We have to mount the file system in this directory.
8. To do so, navigate to the AWS console and click on the created file system. On the
top-right corner, click on Attach
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 8/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
Note2: In the above command we see, it starts with "sudo" since you are already a
super-user, it's ok, if you don't remove sudo.
To display information for all currently mounted file systems, we'll use the command
df -h
sudo -s
w
3. Navigate to the efs directory in both the servers using the command
cd efs
w
4. Create a file in any one server.
touch hello.txt
w
5. Check the file using the command
ls -ltr
w
6. Now go to the other server and give the command
cd efs
w
7. You can see the file created on this server as well. This proves that our EFS is working.
8. You can try creating files (touch command) or directories (mkdir command) on
other servers to continue to grow the EFS implementation.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 9/11
8/7/23, 9:24 AM Mount Elastic File System (EFS) on EC2
Do you Know ?
EFS uses the Network File System (NFS) protocol, which enables EC2 instances to mount
EFS as a network file system, providing a common data source for applications running
on multiple instances.
1. Once the lab steps are completed, please click on the Validation button on the left
side panel.
2. This will validate the resources in the AWS account and displays whether you have
completed this lab successfully or not.
3. Sample output :
3. You have successfully installed the NFS Client and mounted EFS to the instances.
End Lab
1. Sign out of AWS Account.
3. Once you have completed the steps, click on End Lab from your whizlabs dashboard.
https://www.whizlabs.com/labs/mount-elastic-file-system-efs-on-ec2 11/11