confirm efs is mounted on ec2
7,750
Solution 1
To mount an EFS (nfs) volume on Amazon AWS do
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 volumeID.efs.zone.amazonaws.com:/ /your/mountpoint
You could also add an "automount" option on /etc/fstab , so it is persistend after a reboot (add it as last line)
volumeID.efs.zone.amazonaws.com:/ /your/mountpoint nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0
Please note that you shoud have installed nfs-utils (if running under centos or rhel like) or nfs-common (debian and ubuntu like)
Solution 2
ok, i did find that when the efs is mounted correctly, you do see a response with the command for df -h like
fs-xxxxxxxx.efs.us-east-1.amazonaws.com:/ 8.0E 0 8.0E 0% /data
also needed to make sure that the EFS security group allowed 'entry' from my ec2's security group
Related videos on Youtube
Author by
user1709076
Updated on September 18, 2022Comments
-
user1709076 over 1 year
i would like to confirm that efs is mounted on my ec2 instance but do not know the command.
i did mount my EFS to the directory ''/data''
i think the correct command would be
df -h
Filesystem Size Used Avail Use% Mounted on udev 996M 12K 996M 1% /dev tmpfs 201M 356K 200M 1% /run /dev/xvda1 7.8G 2.2G 5.3G 29% / none 4.0K 0 4.0K 0% /sys/fs/cgroup none 5.0M 0 5.0M 0% /run/lock none 1001M 0 1001M 0% /run/shm none 100M 0 100M 0% /run/user
but i am no sure.
-
Federico Galli almost 7 yearsOR you can use the command "mount", but looks like it is not mounted
-
user1709076 almost 7 yearsthanks yeah, it did turn out it was not mounted. i found it was mounted when i did it right by doing 'df -h'.
-