Create an EFS file system
The process of Creating and Mounting an Elastic File System is divided into four steps:
Creating an EFS File system
You may use Amazon EFS to establish a file system that many instances can access and mount simultaneously. In the Amazon Elastic File System User Guide, see Creating Resources for Amazon EFS for further details.
For creating a file system, below are the steps followed:
-
Go to https://console.aws.amazon.com/efs/ to access the Amazon Elastic File System console.
- Select Create file system.
- (Optional) Enter a name for the file system in the Name field. This generates a tag with Name as the key and the file system name as the value.
- Select the Virtual Private Cloud (VPC) to utilize for your instances.
- Select Create.
- Take note of the file system ID when it has been created. It will be utilized later in the tutorial.
- Select the file system ID.
- Select Network, Manage from the file systems screen. View the mount targets created by Amazon EFS in each Availability Zone in the Region where your VPC is located.
- Select Save.
Mount the EFS File System to the Instance
Mount the file system
For launching instances followed by mounting an EFS file system:
-
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ Choose an Amazon Machine Image (AMI), and select an Amazon Linux AMI.
- Choose Launch Instance. Choose an Instance Type, keep the default instance type, t2.micro, and choose Next: Configure Instance Details.
- Configure Instance Details, do the following:
- Specify the Number of instances.
- [Default VPC] If you have a default VPC, that is the Network value.
- [Nonstandard VPC] Choose your VPC as Network and a public subnet as Subnet. Select Enable for Auto-assign Public IP. Otherwise, your instances will not be assigned public IP addresses or DNS names.
- Select Add file system under File systems. Check that the value corresponds to the file system ID you generated in Step 1.
- Proceed to the wizard's Step 6.
- Select Configure Security Group on the Configure Security Group page. Choose an existing security group and the security group you created in Prerequisites.
- Choose Review and Launch.
- Pick an existing security group and select the security group that you created in Prerequisites on the Configure Security Group page. Then, choose Review and Launch.
- Select Launch from the Review Instance Launch page.
-
Select an existing or create a new key pair in the Select an existing key pair or create a new key pair dialogue box. Check the acknowledgment box and then click Launch Instances.
- Select Instances from the navigation pane to view the status of your instances. Their initial status is pending. Your instances are ready to utilize once the status changes to running.
- Your instance is now set to mount the Amazon EFS file system at startup, and every time it reboots.
Test the file system
To verify that the file system is mounted, follow these steps:
- Link to your instances. See Connect to your Linux instance for additional details.
- Run the df -T command from the terminal window for each instance to ensure that the EFS file system is mounted.
$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/xvda1 ext4 8123812 1949800 6073764 25% /
devtmpfs devtmpfs 4078468 56 4078412 1% /dev
tmpfs tmpfs 4089312 0 4089312 0% /dev/shm
efs-dns nfs4 9007199254740992 0 9007199254740992 0% /mnt/efs
The file system name, shown in the sample output as efs-DNS, has the following format.
file-system-id.efs.aws-region.amazonaws.com:/
Clean up
After completing this instruction, you can end the instances and erase the file system.
To stop the instances:
- Go to https://console.aws.amazon.com/ec2/ to access the Amazon EC2 console.
- Select Instances from the navigation pane.
- Choose which instances to terminate.
- Select Instance state, then Terminate instance.
- When requested for confirmation, choose Terminate.
To get rid of the file system.
-
Go to https://console.aws.amazon.com/efs/ to access the Amazon Elastic File System console.
- Choose the file system to be deleted.
- Select Actions, then Delete File System.
- Enter the file system ID and choose a Delete file system when asked.
Frequently Asked Questions
What applications does Amazon EFS support?
Amazon EFS is designed to handle diverse workloads and applications, such as Big Data and analytics, media processing workflows, content management, web serving, and home directories.
How do I put information into a file system?
To transport data files to Amazon EFS, you may also utilize conventional Linux copy tools. For further information, refer to the On-premises Access section of this FAQ.
How much data can I store?
Petabytes of data may be stored on Amazon EFS file systems. Amazon EFS file systems are elastic, meaning they expand and contract as you add and delete data. You do not pre-provision file system size, and you only pay for what you use.
How many file systems am I allowed to create?
Each area can have up to 1,000 file systems. Please refer to the Amazon EFS Limits page for further details.
Encrypting your data has little to no impact on I/O latency and performance.
Conclusion
So, we end our above blog here. Above, we have extensively discussed AWS Elastic File System. We studied how to create a File system and Mount it on the instance. Further, we also saw how to test and clean the File System. We hope that this blog has helped you enhance your knowledge regarding AWS Elastic File System and if you would like to learn more.
Check out this article - File System Vs DBMS
Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, System Design, JavaScript, etc. Enroll in our courses, refer to the mock test and problems available, interview puzzles, and look at the interview bundle and interview experiences for placement preparations.
Do upvote our blog to help other ninjas grow. Happy Coding!”