I added an Amazon Elastic File System (Amazon EFS) mount entry in the /etc/fstab on my Amazon Elastic Compute Cloud (Amazon EC2) instance. I want Amazon EFS to automatically mount on reboot.
Short description
To automatically mount on reboot, Amazon EFS uses the Amazon EFS mount helper or the Linux NFS client. The automount might fail for the following reasons:
- The Amazon EFS mount helper isn't installed.
- The Linux NFS client isn't installed.
- The _netdev option isn't included in the Amazon EFS mount entry in /etc/fstab.
Resolution
Amazon EFS mount helper
The Amazon EFS mount helper is part of the amazon-efs-utils package. amazon-efs-utils is preinstalled on Amazon Linux 2023, Amazon Linux 2, and Amazon Linux Amazon Machine Images (AMIs). The package is available in the Amazon Linux package repositories. You can build and install the package on other Linux distributions.
Check if the amazon-efs-utils package is installed on the instance:
$ rpm -qa amazon-efs-utils
If the package isn't installed, then run the following command:
$ sudo yum install -y amazon-efs-utils
For more information, see Installing the Amazon EFS client on Amazon EC2 Linux instances.
To install amazon-efs-utils on other Linux distributions, see Installing the Amazon EFS client on other Linux distributions.
Linux NFS client
Verify that the Linux NFS client is installed on the instance.
Note: Use the Linux NFS client only when encryption or access points aren't used.
If the package isn't installed, then run the following commands:
Amazon Linux AMIs, RHEL
$ sudo yum -y install nfs-utils
Ubuntu
$ sudo apt-get -y install nfs-common
To start the service, run one of the following commands:
$ sudo service nfs start
-or-
$ sudo service nfs-server start
For more information see, Using Network File System to mount EFS file systems.
_netdev option
If you don't use the _netdev option in the Amazon EFS mount entry in /etc/fstab, then the automount might fail. The _netdev option prevents the operating system from an Amazon EFS mount until the EFS required network access is activated on the network.
Related information
Recommended NFS mount options