Mount EFS on AWS EC2

To set up your EC2 instance:

  1. Using the Amazon EC2 console, associate your EC2 instance with a VPC security group that enables access to your mount target. For example, if you assigned the "default" security group to your mount target, you should assign the "default" security group to your EC2 instance. Learn more
  2. Open an SSH client and connect to your EC2 instance. (Find out how to connect.)
  3. If you're using an Amazon Linux EC2 instance, install the EFS mount helper with the following command:
    sudo yum install -y amazon-efs-utils
    You can still use the EFS mount helper if you're not using an Amazon Linux instance. Learn more

    If you're not using the EFS mount helper, install the NFS client on your EC2 instance:
    • On a Red Hat Enterprise Linux or SUSE Linux instance, use this command:
      sudo yum install -y nfs-utils
    • On an Ubuntu instance, use this command:
      sudo apt-get install nfs-common

Mounting your file system

  1. Open an SSH client and connect to your EC2 instance. (Find out how to connect).
  2. Create a new directory on your EC2 instance, such as "efs".
    • sudo mkdir efs
  3. Mount your file system with a method listed following. If you need encryption of data in transit, use the EFS mount helper and the TLS mount option. Mounting considerations
    • Using the EFS mount helper:
      sudo mount -t efs fs-6c7b09c5:/ efs
    • Using the EFS mount helper and the TLS mount option:
      sudo mount -t efs -o tls fs-6c7b09c5:/ efs
    • Using the NFS client:
      sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-6c7b09c5.efs.us-west-2.amazonaws.com:/ efs

If you can't to connect, see our troubleshooting documentation.

Add comment


Security code
Refresh

Category: