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?

질문됨 3달 전268회 조회
2개 답변
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
전문가
답변함 3달 전
  • 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.

답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠