Access denied by server when try to mount efs to an ec2 instance in the same VPC

0

Hi,

I'm trying to mount an EFS to an ec2 instance in the same VPC using the command below: sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <ip address of the EFS>:/ <mount point>. But I got message 'mount.nfs: access denied by server while mounting <ip address of the EFS>'.

Here's the CloudTrail event record: { "eventVersion": "1.08", "userIdentity": { "type": "AWSAccount", "principalId": "", "accountId": "ANONYMOUS_PRINCIPAL" }, "eventTime": "2024-02-19T03:51:42Z", "eventSource": "elasticfilesystem.amazonaws.com", "eventName": "NewClientConnection", "awsRegion": "us-west-2", "sourceIPAddress": "AWS Internal", "userAgent": "elasticfilesystem", "errorCode": "AccessDenied", "requestParameters": null, "responseElements": null, "eventID": "<event ID>", "readOnly": true, "resources": [ { "accountId": "HIDDEN_DUE_TO_SECURITY_REASONS", "type": "AWS::EFS::FileSystem", "ARN": "arn:aws:elasticfilesystem:us-west-2:<aws account>:file-system/<efs-id>" } ], "eventType": "AwsServiceEvent", "managementEvent": true, "recipientAccountId": "<aws account>", "sharedEventID": "<event ID>", "serviceEventDetails": { "permissions": { "ClientRootAccess": false, "ClientMount": false, "ClientWrite": false }, "sourceIpAddress": "<ip of the ec2 instance>" }, "eventCategory": "Management" }

What shall I do to resolve the access denied issue?

asked 3 months ago279 views
2 Answers
1

This issue can occur if your NFS client does not have permission to mount the file system. Follow this troubleshooting to fix it:

profile picture
EXPERT
answered 3 months ago
  • I tried the solutions suggested in the document above but couldn't resolve the issue. When I use the command below with iam param 'sudo mount -t nfs -o iam,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <ip address of the EFS>:/ <mount point>, I got message 'mount.nfs: an incorrect mount option was specified'.

  • This error message most likely means that your Linux distribution doesn't support Network File System versions 4.0 and 4.1 (NFSv4). To confirm this is the case, you can run the following command.

    grep CONFIG_NFS_V4_1 /boot/config*

    Resources:

  • I also ran grep command with results below: CONFIG_NFS_V4_1=y CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"

    CONFIG_NFS_V4_1_MIGRATION is not set

  • which Linux Distribution are you using? Because NFSv4.1 is not supported on your Linux distribution. Try to check NFS Support

  • The ec2 instance is using al2023-ami-2023.3.20240205.2-kernel-6.1-arm64, which is the latest linux/arm64 ami from aws. It comes with NFS client installed by default.

0

In the end, we managed to mount using the EFS mount helper.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions