1

I would like to mount an AWS EFS location with the efs driver which internaly uses nfs. Now the question is: How do I automatically mount a location with specific uid and gid? With sshfs e.g. I would just define uid, gid as mount options, but it's not implemented in nfs.

3

A regular Linux NFS server would do the trick with the following combination of /etc/exportfs options:

all_squash,anonuid=xxx,anongid=yyy

Citing man 5 exports:

  • all_squash - Map all uids and gids to the anonymous user.
  • anonuid and anongid - These options explicitly set the uid and gid of the anonymous account.

With Amazon EFS you'll need locally mounted bindfs layer to change permissions as the server export options cannot be changed.

Please take a look at this Unix & Linux StackExchange question.

It looks like the bindfs currently lacks ability to map all users/groups into one but I guess it could be added to the code quite easily.

  • Thanks, bindfs might be that, eventhough I dont like the idea of having another program taking care of the permissions as a fuse bind. Reasons are performance, and stability. There is no automount option when something goes wrong with the NFS mount. – Aley Oct 19 '18 at 6:43
  • Not work for me to mount AWS EFS with command sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <filesystem id>.efs.cn-northwest-1.amazonaws.com.cn:/ /mnt/efs. – Kane Jan 29 at 13:29
0

Seems like just setting the user and permission on the files, do the job. So nfs is supporting standard fs file permissions and attributes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.