Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount AWS EFS to Macbook or local computers

I am trying to mount AWS EFS to my local MacBook (also other local computers) However, it is not working.

My port 22 and 2049 is wide open as a testing.

I tried few command like mount -t nfs4 -o nfservers=4.1 xxx.xxx.xxx.xxx:/ efs/

But I am keep getting a connection timed out error.

Also I tried mounting this EFS to another AWS account EC2 instances. But keep getting same error.

For example, I have EFS in Account1 and EC2 in Account2 (Different VPC) and trying:

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 xxx.xxx.xxx.xxx:/ /efs/

It is not working unless I have my EC2 in the same account (which is account1).

Is there a way I can mount this EFS in different account or local computers?

like image 599
anniepark90 Avatar asked Dec 07 '16 20:12

anniepark90


People also ask

Can I mount EFS on Mac?

You can now mount your Amazon EFS file systems on your instances by using the Amazon EFS client, an open source toolset, installed using the Homebrew package manager. You can also mount your Amazon EFS file systems on your instances using the macOS native NFS client version 4.0.

Can EFS be mounted on premise?

You can mount your Amazon EFS file systems on your on-premises data center servers when connected to your Amazon VPC with AWS Direct Connect or VPN.

How do I mount an EFS file system on AWS EC2?

On the Configure instance page, under File systems, choose the EFS file system that you want to mount. The path shown next the file system ID is the mount point that the EC2 instance will use. You can change this path, if needed.

Can I mount an EFS file system with an IP address?

As an alternative to mounting your Amazon EFS file system with the DNS name, Amazon EC2 instances can mount a file system using a mount target’s IP address. Mounting by IP address works in environments where DNS is disabled, such as VPCs with DNS hostnames disabled, and EC2-Classic instances mounting using ClassicLink.

Why can't I mount a file system when a new EC2 instance?

Mounting a file system when a new EC2 instance launches Amazon EFS does not support mounting from Amazon EC2 Windows instances. The EFS mount helper is part of the amazon-efs-utils package.

How do I Mount EFS files using the Mount helper?

For various mounting options using the mount helper, see Automatically mount EFS using /etc/fstab with EFS mount helper. Note: You can mount your file system using an IP address of a mount target in a different Availability Zone than the client (Amazon Elastic Compute Cloud (Amazon EC2)).


3 Answers

For those who are curious, try

sudo mount -t nfs -o vers=4,tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 -w host_ip:/ efs

worked for me via direct connect.

like image 165
capitalg Avatar answered Sep 26 '22 21:09

capitalg


sudo mount -t nfs -o vers=4,tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 -w host_ip:/ efs

I have tried using the AWS Client connect VPN i.e. P2S VPN. it worked for me as well. With the latest changes now the EFS can be connected from your local machine using AWS VPN.

To access EFS file systems from on-premises, you must have an AWS Direct Connect or AWS VPN connection between your on-premises datacenter and your Amazon VPC.

like image 35
chandra Avatar answered Sep 23 '22 21:09

chandra


What worked for me was to mount it to an EC2 ("on-premises"), give myself SSH access to that server, and then use sshfs to access it.

sshfs -o allow_other,IdentityFile={YOUR_SSH_KEY} {REMOTE_USERNAME}@{YOUR_URL}:/{YOUR}/{FOLDER}/{ON_REMOTE} /{YOUR}/{LOCAL}/{FOLDER}
like image 35
blisstdev Avatar answered Sep 22 '22 21:09

blisstdev