• Mount EFS on EC2 Instance and Add Mount Automatically
    Black Skirt 60

    Mount EFS on EC2 Instance and Add Mount Automatically

    The above video is linked to my YouTube channel :

    Amazon Elastic File System (Amazon EFS) is a scalable, fully managed file storage service provided by Amazon Web Services (AWS). It is designed to provide scalable, elastic, and highly available file storage for use with AWS cloud services and on-premises resources.

    Key features of Amazon EFS include:

    1. Scalability: Amazon EFS can automatically scale to petabytes of data, allowing users to grow or shrink their file system capacity as needed without provisioning or managing storage infrastructure.
    2. Elasticity: Amazon EFS can handle thousands of concurrent client connections and scale throughput and IOPS (input/output operations per second) automatically in response to workload demands.
    3. High Availability: Amazon EFS is designed for high availability and durability, with data stored redundantly across multiple Availability Zones within a region to ensure resilience against failures.
    4. Compatibility: Amazon EFS supports the Network File System version 4 (NFSv4) protocol, making it compatible with a wide range of applications and operating systems, including Linux, Windows, and macOS.
    5. Performance: Amazon EFS provides low-latency access to data and high throughput performance for a wide range of workloads, including big data analytics, media processing, content management, and web serving.
    6. Security: Amazon EFS supports encryption of data at rest and in transit using industry-standard encryption protocols, helping users meet their security and compliance requirements.
    7. Integration: Amazon EFS integrates seamlessly with other AWS services, such as Amazon EC2 (Elastic Compute Cloud), AWS Lambda, Amazon ECS (Elastic Container Service), and AWS Batch, allowing users to easily deploy and manage applications that require shared file storage.

    Amazon EFS is well-suited for a variety of use cases, including web serving, content management, development and testing environments, container storage, big data analytics, and media processing. It offers a simple and cost-effective way to access scalable and reliable file storage in the cloud, without the need to manage complex storage infrastructure.

    To mount an Amazon Elastic File System (EFS) on an EC2 instance and add the mount automatically, you’ll need to follow these steps:

    Step 1: Create an Amazon EFS File System:

    1. Go to the Amazon EFS console: Amazon EFS Console
    2. Click on “Create file system.”
    3. Configure your EFS file system settings, including the VPC, availability zones, and security groups.
    4. Click “Create file system.”

    Step 2: Note Down EFS File System ID and DNS Name:

    After creating the EFS file system, note down the following details:

    Step 3: Attach EFS to EC2 Instance:

    1. Go to the EC2 console: Amazon EC2 Console
    2. Select your EC2 instance.
    3. Click “Actions” > “Attach File System.”
    4. Select the EFS file system you created earlier and click “Attach.”

    Step 4: Install NFS Client on EC2 Instance:

    Connect to your EC2 instance via SSH and install the NFS client package:

    sudo yum install -y nfs-utils

    Step 5: Create a Mount Point Directory:

    Create a directory on your EC2 instance where you want to mount the EFS file system:

    sudo mkdir /mnt/efs

    Step 6: Mount EFS File System Manually:

    Run the following command to mount the EFS file system on your EC2 instance:

    sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${efs_dns_name}:/ /mnt/efs

    Replace ${efs_dns_name} with the DNS name of your EFS file system.

    Step 7: Automate Mounting on Instance Reboot:

    To ensure that the EFS file system is mounted automatically on instance reboot, you can add an entry to the /etc/fstab file:

    1. Open the /etc/fstab file in a text editor:
    sudo nano /etc/fstab
    1. Add the following line to the end of the file:
    ${efs_dns_name}:/ /mnt/efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0

    Replace ${efs_dns_name} with the DNS name of your EFS file system.

    1. Save and exit the text editor.

    Step 8: Test Mounting and Reboot EC2 Instance:

    Test that the EFS file system is mounted correctly:

    sudo mount -a

    Reboot your EC2 instance to ensure that the mount happens automatically on reboot:

    sudo reboot

    After the instance reboots, verify that the EFS file system is mounted correctly:

    df -h

    You should see the EFS file system mounted at the specified mount point (/mnt/efs).

    That’s it! You’ve successfully mounted an Amazon EFS file system on an EC2 instance and configured it to mount automatically on instance reboot.



    Note:

    Please subscribe to my YouTube channel Click Me

    If you enjoyed this video, I encourage you to subscribe to my YouTube channel.
    Follow us on My YouTube channel for more details on building WordPress website.
    Copyright ©2026

    Comment

    We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy .
    Posting comment on "Mount EFS on EC2 Instance and Add Mount Automatically"
    1 2 3 4 5
    Thank you for your comment.

    There is no comment for this post currently,
    be the first one to write a comment.
    Categories: Video