Why doesn't my EFS file system automatically mount when rebooting my EC2 instance?
Last updated: 2022-06-22
I've added an Amazon Elastic File System (Amazon EFS) mount entry in the /etc/fstab on my Amazon Elastic Compute Cloud (Amazon EC2) instance. Amazon EFS doesn’t automatically mount on reboot. How can I fix this?
Amazon EFS auto mounts on reboot using the Amazon EFS mount helper or the Linux NFS client. Auto mounting 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 EFS mount entry in /etc/fstab.
Amazon EFS mount helper
The Amazon EFS mount helper is a part of amazon-efs-utils. This package is available for installation on Amazon Linux and Amazon Linux 2 AMIs.
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 to install it Amazon Linux and Amazon Linux 2 AMIs:
$ sudo yum install -y amazon-efs-utils
For more information, see Installing the Amazon EFS client on Amazon Linux and Amazon Linux 2.
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 to install it:
Amazon Linux 1, Amazon Linux 2, RHEL
$ sudo yum -y install nfs-utils
$ sudo apt-get -y install nfs-common
Run one of the following commands to start the service:
$ sudo service nfs start
$ sudo service nfs-server start
For more information see, Installing the NFS client.
The automount could fail if _netdev option isn't used in the EFS mount entry in /etc/fstab. The _netdev option prevents the operating system from mounting EFS until the network is enabled as EFS required network access.