So I'm trying to use AWS EFS with EC2 to have persistent storage between multiple instances.
I'm mounting the drive using, sudo mount -t nfs4 -o nfsvers=4.1 $(curl -s http://IPADDRESSHERE/latest/meta-data/placement/availability-zone).FILESYSTEMIDHERE.ZONEHERE.amazonaws.com:/ /mydir. I have replaced some of the key information with placeholders for security reasons.
After running that nothing happens it just goes right back to the terminal no success message and no error message so I assume it worked.
I create a folder or file inside /mydir and ls /mydir and everything shows up fine.
Then I unmount the drive using sudo umount /mydir. Once again after running that no error but no success message so I assume it worked. All the files stay in the folder and nothing changes after running that.
Then I create a new directory and mount the drive to that new directory and none of the files or folders I created show up in that new folder.
So it looks like it's not even saving to the EFS drive if when mounting to a new folder it doesn't even sync down the files. Any ideas on how to get this working? Thanks so much in advance.
To your original question: if you mount a filesystem "on top" of your current working directory, you will not see the contents of the mounted fs, nor will you be able to save content to that fs until you cd back to the parent directory and then enter the mounted fs again.
When you write data, it consumes space on whatever filesystem it is written to. In the case of EFS, data saved there will not affect usage of your EBS volumes.
Not the answer you're looking for? Browse other questions tagged amazon-ec2 amazon-web-services filesystems network-share or ask your own question.
Shutting an EC2 instance down locally (on the instance)?