I have already mounted AWS EFS one folder in EC2 instance. I want to mount another one folder in same AWS EFS. Is this possible?
You can use a Symbolic Link.
mkdir -p /mnt/efs
echo "${FileSystem}.efs.${AWS::Region}.amazonaws.com:/ /mnt/efs nfs4 defaults" >> /etc/fstab
mount -a
ln -s /var/www/html/media /mnt/efs/media
ln -s /var/www/html/var /mnt/efs/var
First your create a root directory for the mount point (/mnt/efs
). Them you mount the FileSystem in this directory (/mnt/efs
).
Now for example, if you want to map /var/www/html/media
create a symbolic link pointing to the mounted point (ln -s /var/www/html/media /mnt/efs/media
). This will create a folder in /mnt/efs/media
.