VOOZH about

URL: https://thenewstack.io/tutorial-configure-and-mount-an-efs-file-system-in-amazon-ec2-instance/

⇱ Tutorial: Configure and Mount an EFS File System in Amazon EC2 Instance - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-11-03 09:21:01
Tutorial: Configure and Mount an EFS File System in Amazon EC2 Instance
feature,tutorial,
Cloud Services / Serverless / Storage

Tutorial: Configure and Mount an EFS File System in Amazon EC2 Instance

In this tutorial, I will walk you through the steps involved in creating an Amazon EFS file system and mounting it in an EC2 instance. This article is a part of the series on making AWS Lambda functions stateful with Amazon EFS.
Nov 3rd, 2020 9:21am by Janakiram MSV
👁 Featued image for: Tutorial: Configure and Mount an EFS File System in Amazon EC2 Instance

In this tutorial, I will walk you through the steps involved in creating an Amazon EFS file system and mounting it in an EC2 instance. This article is a part of the series on making AWS Lambda functions stateful with Amazon EFS.

Create an Amazon EFS File System

Start by accessing the EFS section of the AWS Management Console. Click on the Create file system button to create the file system. Choose one of the VPCs from the dropdown. I suggest that you select the default VPC available in the chosen region.

👁 Image

Once the file system is created, click on the Access points tab to create an access point for our machine learning application.

Ensure that the root directory is /ml. It is more helpful to create a well-known root directory than the default option.

👁 Image

Configure the User ID and Group ID of POSIX user and root user as 1001. This is used in managing the and ownership and permissions of the file system.

👁 Image

Let’s have 777 as permission for the root directory path.

👁 Image

Finally, click on Create access point to finish the configuration.

Choose the Network tab to verify the availability of the EFS file system in all the subnets of the VPC.

The EFS file system is now ready. In the next step, we will access this from an Amazon EC2 instance.

Mount the EFS File System in Amazon EC2 Instance

In the first step of the EC2 launch wizard, choose the 64-bit Amazon Linux 2 AMI.

👁 Image

In the next step, choose t2.medium instance type.

👁 Image

In the third step, click on Add file system and choose the EFS created for this tutorial. Notice that the wizard has added the user data to mount the file system.

👁 Image

In the sixth step, choose the default security group along with a custom security group that has ports 22 and 5000 open. This configuration will let us SSH into the instance and also access the inference endpoint which will be exposed by the Python application.

👁 Image

Review and launch the instance.

Once the instance is in running mode, SSH into it to check if the EFS file system is mounted.

👁 Image

You should see the directory /mnt/efs/fs1/ which represents the same EFS file system that we created.

In the next part of this series, we will install PyTorch in the shared file system and run an inference service to test the environment. Stay tuned.

Janakiram MSV’s Webinar series, “Machine Intelligence and Modern Infrastructure (MI2)” offers informative and insightful sessions covering cutting-edge technologies. Sign up for the upcoming MI2 webinar at http://mi2.live.

Amazon Web Services is a sponsor of The New Stack.

Feature image by Martin Adams on Unsplash.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.