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?
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.
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.
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.
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.
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.
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)).
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.
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.
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}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With