• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

securitywing

How to Mount Amazon EFS in EC2-CentOS Instance

by wing

With Amazon EFS(elastic file system)mounted in the EC2, you can signifincalty reudce cost of storge becaues you pay only for the storgrage used by your applications/data. EFS supports NFS

In the AWS console, search for EFS and then create a volume. When you attahce a security group in the EFS, make sure it allows traffc on port 22 from the EC2 instance. Also, take note of the DNS name of  EFS, which will be used to mount the volumen in the EC2.

SSH to the Ec2 and create a mount directory.

sudo mkdir efs

Note:if you want you can specify the full path of the mount directory such as /home/efs or /var/efs

 

Next, take a note of the NFS endpoint DNS name and add the following line in the fstab. Remember to replace the  endpoint by yours.

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-033a1bcb.efs.eu-west-1.amazonaws.com:/   efs

 

to auto mount the EFS when the EC2 instance restarts, you can add the mount -a in the /etc/fstab. Add the following lines to permanently  mount the EFS

 

fs-033a1bcb.efs.eu-west-1.amazonaws.com:/   /home/centos/efs  nfs4 defaults,_netdev 0 0

after adding the mount point the fstab, you need to run:

sudo mount -a

now, if you reboot the instance, the EFS will be auto mounted.

To verify the EFS mount status  run the following command:

$ df -T

Related posts:

  1. How to Setup AWS CloudFront for Externally Registered Domain Name
  2. 32 Effective Home Security Checklist
  3. How to Build High Availability Web Server with GlusterFS on Debian
  4. 5 Steps to Auto-Create Helm  Charts and upload to S3 Using Jenkins

Filed Under: Off Track Tagged With: AWS, efs

Primary Sidebar

Please help us sharing

Categories

  • AWS
  • Basics
  • Containers
  • Cryptocurrency
  • Cyber
  • Internet Security and Safety
  • IS Audit
  • IT Security Exams
  • Law & Human Rights
  • Network Security Tips
  • Off Track
  • Social Media Governance
  • Tech Comparisons
  • Tech Stack Suitability
  • Telecom
  • Tutorial

CISSP Sample Test

Take a CISSP Sample Test

CISA Sample Test

CISA IT governance Sample test

Please Follow Us

Contact us for Ads

Go to Contact Form

Search

Footer

Copyrights

Protected by Copyscape Duplicate Content Detection Software

Securitywing.com reserves the copyrights of all of its published articles.No contents of this site is permitted to be published to anywhere else in the Internet.If any contents are found in any other websites, securitywing reserves the rights to file a DMCA complaint. But you have the right to use the link of any relevant article of this site to point from your website if you consider that it might improve the quality of your article.

Tags

audit AWS backup basics browser check cisco cloud computer configuration cyber data database email gmail hsrp ids iis informaiton internet kubernetes linux load balancing malware microsoft network protection redundancy risk router security security tips server social media SSL switch test tools vpn vrrp web webserver website windows wordpress

Copyright © 2010-2025 ·All Rights Reserved · SecurityWing.com