Create and Attach EFS Volume in Linux using Private IP

This blog describes how to create and attach EFS Volume by using Linux through Private IP.

Creation of EFS Volume :

 

Step 1: Click the create file system option in the EFS console and we will get a pop-up window. Just click the customize option for the creation of EFS Volume.

Attach EFS Volume in Linux through private IP

 

Step 2: Provide a name for the File System and select regional.

We are going to store our application data in this File system. So selecting regional is recommended for this purpose.

Enable automatic backup is using AWS backup service with default settings. It is recommended to manually configure AWS backup for EFS based on your needs.

Life cycle management is disabled. Because we don’t want our application

files to be archived.

Attach EFS Volume in Linux through private IP

 

Step 3: We have selected the general-purpose performance mode. Once EFS is created, we can’t change the performance mode.

Choose the performance mode as per your needs. ( Ref : https://docs.aws.amazon.com/efs/latest/ug/performance.html#performancemodes )

We have selected the Bursting throughput mode. Choose the throughput mode as per your needs.

Enable encryption of data at rest is recommended. Our data will be encrypted in AWS EFS storage.

Tags are optional but it is recommended.

Attach EFS Volume in Linux through private IP

 

Step 4: Select the same VPC as our instance configured. We have selected the default VPC. Our instance launched in a default vpc.

Select all the subnets. We are going to launch EC2 instances in all Availability zones by using Auto Scaling. So We need mount targets for all the Availability zones.

Select the appropriate Security groups. In this, we are going to use the newly created security group which used in our EC2 instance.

Attach EFS Volume in Linux through private IP

 

 

Step 5: File system policy is optional. Select or create a policy based on your needs. In this, we deselected the policy.

Attach EFS Volume in Linux through private IP

 

Step 6: Review the EFS resource and create the File system.

In this below screenshot we can get the details about which option we can edit and which can’t after the creation of EFS.

Attach EFS Volume in Linux through private IP

 

Step 7: Our EFS is created and available now.

Attach EFS Volume in Linux through private IP

Steps to Attach EFS Volume:

 

Step 1: Log in to the Linux server and update the apt-cache.

Command : # apt update

Attach EFS Volume in Linux through private IP

Step 2: Go to AWS EFS Console and select the appropriate File System and click the Attach option in the top-right corner.

Attach EFS Volume in Linux through private IP

Step 3: Select the Mount via IP option and appropriate Availability Zone.

Copy the below command which is needed to be executed in the Linux server.

Attach EFS Volume in Linux through private IP

 

Step 4: Go to the AWS EC2 Security group console and select our Linux Server, the security group.

In that security group, Edit the inbound rules and allow all traffic to the same security group.

So that Our EFS and EC2 instances can communicate without any issues.

Attach EFS Volume in Linux through private IP

 

Step 5: Back to the Linux server, We need to install the NFS Utility and mount the EFS.

Command : # apt install nfs-common -y

Attach EFS Volume in Linux through private IP

Create a directory named /var/www in the Linux server.

Command : # mkdir /var/www

Note: We can create any directory.

Modify and execute the command copied from the EFS console. Now our EFS is mounted in the /var/www directory.

Command : # sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 172.31.20.56:/ /var/www

# df -h

Attach EFS Volume in Linux through private IP

 

Step 6: Edit the /etc/fstab file and add the below lines to mount EFS permanently.

172.31.20.56:/ /var/www nfs4

nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0

Attach EFS Volume in Linux through private IP

Thus the creating and attaching EFS Volume in Linux using Private IP done.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support