Using NFS to automatically mount EFS file systems
To update the /etc/fstab
file on your EC2 instance
-
Connect to your EC2 instance:
-
To connect to your instance from a computer running macOS or Linux, specify the .pem file for your SSH command. To do this, use the
-i
option and the path to your private key. -
To connect to your instance from a computer running Windows, you can use either MindTerm or PuTTY. To use PuTTY, install it and convert the .pem file to a .ppk file.
For more information, see the following topics in the Amazon EC2 User Guide for Linux Instances:
-
Open the
/etc/fstab
file in an editor.-
To automatically mount a file system using NFS instead of the EFS mount helper, add the following line to the
/etc/fstab
file.Replace
file_system_id
with the ID of the file system you are mounting.Replace
aws-region
with the AWS Region that the file system in, such asus-east-1
.Replace
mount_point
with the file system's mount point.
file_system_id
.efs.aws-region
.amazonaws.com:/mount_point
nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0
The line of code you added to the /etc/fstab
file does the
following.
Field | Description |
---|---|
|
The ID for your Amazon EFS file system. You can get this ID from the console or programmatically from the CLI or an AWS SDK. |
|
The mount point for the EFS file system on your EC2 instance. |
|
Specifies the file system type. |
|
The comma-separated list of mount options for the file system:
|
|
Specifies the |
|
Tells the |