I'm on Windows and I'm trying to mount my EFS on WSL via SSH port forwarding.
I can successfully set up port forwarding to a jump server in my VPC:
ssh -f -N -L 1234:172.31.43.109:2049 ec2-user@ec2-3-82-56-228.compute-1.amazonaws.com
…and then mount the filesystem with the nfs
mount type:
sudo mount -t nfs4 -o port=1234 localhost:/ /efs
I can now browse /efs
on WSL and even run explorer.exe .
to view the files in the Windows File Explorer.
However, I can't create files because I don't have permissions. I've created an access point with POSIX user 0
and group 0
and all files in EFS have that ownership. I can create files in WSL by only using sudo
, as expected. I want to be able to create files in Windows File Explorer, though. I think this could be fixed by mounting EFS with my access point, and this is where I start getting issues.
I've installed amazon-efs-utils
on WSL and tried to mount EFS with the efs
type like so:
sudo mount -t efs -o tls,accesspoint=fsap-0a18c15383236b5d3,mountport=1234 fs-003f3467bf1e15b13:/ /efs
…but I get this error:
Failed to resolve "fs-003f3467bf1e15b13.efs.us-east-1.amazonaws.com" - check that your file system ID is correct, and ensure that the VPC has an EFS mount target for this file system ID.
See https://docs.aws.amazon.com/console/efs/mount-dns-name for more detail.
Attempting to lookup mount target ip address using botocore. Failed to import necessary dependency botocore, please install botocore first.
Since I have port forwarding, I want the DNS name to resolve to localhost
, because that's where the actual connection can be made, so I added this line to /etc/hosts
:
127.0.0.1 fs-003f3467bf1e15b13.efs.us-east-1.amazonaws.com
If I run the mount command now, I get a different error:
Traceback (most recent call last):
File "/sbin/mount.efs", line 3718, in <module>
main()
File "/sbin/mount.efs", line 3696, in main
mount_tls(
File "/sbin/mount.efs", line 2827, in mount_tls
with bootstrap_tls(
File "/lib/python3.10/contextlib.py", line 135, in __enter__
return next(self.gen)
File "/sbin/mount.efs", line 1538, in bootstrap_tls
start_watchdog(init_system)
File "/sbin/mount.efs", line 1380, in start_watchdog
proc = subprocess.Popen(
File "/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/sbin/status'
And this is where I get stuck. What is this /sbin/status
file? What does it do? I couldn't find anything about it. Are there other ways I can mount EFS with an access point over a tunnel?
Yep, as I said in my question - I can mount EFS as an NFS filesystem and it works out, but I run into trouble with permissions when creating files. That's why I need the EFS helper - it's the only way to mount through an access point.