Guangning Yu's Blog
Home
Code
Data
Setup
Industry
MachineLearning
Archive
Mount the Amazon EFS File System on the EC2 Instance
2020-08-08 09:53:34
1. Create EFS on AWS web portal 2. Edit the security group of EFS to allow access from EC2 instances ![title](/api/file/getImage?fileId=5f2e03844947300603000116) 3. Mount EFS on EC2 ``` sudo mkdir efs ``` ![title](/api/file/getImage?fileId=5f2e04dd4947300603000117) ``` sudo chmod 777 /efs ``` 4. Install `amazon-efs-utils` for auto-remount ``` git clone https://github.com/aws/efs-utils cd efs-utils/ ./build-deb.sh sudo apt-get -y install ./build/amazon-efs-utils*deb ``` 5. Configure IAM role in EC2 (already done) 6. Edit `/etc/fstab` ``` fs-xxxxxxxx:/ /efs efs _netdev,tls,iam 0 0 ``` 7. Test mount ``` sudo mount -fav ``` 8. Add Linux user in the other EC2's group to avoid `readonly` issue ``` sudo usermod -a -G ubuntu guangningyu ``` ``` sudo usermod -a -G guangningyu ubuntu ``` Reference: 1. [Mount the Amazon EFS File System on the EC2 Instance and Test](https://docs.aws.amazon.com/efs/latest/ug/wt1-test.html) 2. [Mounting your Amazon EFS file system automatically](https://docs.aws.amazon.com/efs/latest/ug/mount-fs-auto-mount-onreboot.html) 3. [User and Group ID Permissions for Files and Directories Within a File System](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions.html#accessing-fs-nfs-permissions-uid-gid)
Previous:
SQL Server Queries
Next:
Test PySpark max()/min() function