How To Mount the EFS file system on the EC2 instance
March 13, 2024

Amazon EFS (Elastic File System) is very useful when we need a limitless storage and / or to share the storage with different AWS services such as lambdas, another EC2 instances, ECSs, etc. In order to start using the EFS on our EC2, we need a little bit of a mounting process.  

Although the process is already explained very well https://docs.aws.amazon.com/efs/latest/ug/wt1-test.html, let me explain in my words with a few screenshots for a better understanding.

Prerequisites

  • An EFS is created
  • An EC2 instance is created

SSH into the EC2 instance and run the mount command

First, ssh into the EC2 instance to run the following commands.

You can obtain the EFS_DNS_NAME here and replace it with your EFS DNS name.

Now you can confirm the EFS is mounted. One thing that you need to keep in mind is that if you restart the EC2 instance, you will have to run the mounting command again.

If you need to setup your EC2 instance to automatically mount the EFS on restarts, then refer to the following link. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

Enjoy the flexible and easy to use storage, EFS.

Thanks!

Editor / Park hyuntaek

Hyuntaek.park@twigfarm.net

✏️ Content translation & localization, all in one place.
• Experience the latest AI-powered translator (click)

View featured notes