EC2 — Mount
Progress checklist
Overview
Section titled “Overview”Run all commands in this page inside the SSM session on the EC2 instance. Start a session from your workstation if not already connected:
aws ssm start-session \ --target "$INSTANCE_ID" \ --region "$AWS_REGION"-
Install
amazon-efs-utilsv3.0.0 or newer. RequiredS3 Files requires the updated
amazon-efs-utilspackage that ships with thes3filesmount type support. Run on the instance:Terminal window sudo dnf install -y amazon-efs-utilsConfirm the installed version is 3.0.0 or newer:
Terminal window rpm -q amazon-efs-utils -
Set the file system ID in the session. Required
Export
FS_IDinside the SSM session so the mount command can reference it:Terminal window export FS_ID=fs-0123456789abcdef0 # ← replace with the ID from Setupecho "FS_ID=$FS_ID" -
Create the mount point. Required
Terminal window sudo mkdir -p /mnt/s3files -
Mount the file system. Required
Terminal window sudo mount -t s3files "${FS_ID}:/" /mnt/s3filesAllow the
ssm-userto read the mount root without sudo:Terminal window sudo chmod 755 /mnt/s3files -
Add a persistent fstab entry. Required
This ensures the file system remounts automatically after a reboot:
Terminal window echo "${FS_ID}:/ /mnt/s3files s3files _netdev,noresvport 0 0" \| sudo tee -a /etc/fstabVerify the entry was written correctly:
Terminal window grep s3files /etc/fstab
Next step
Section titled “Next step”Continue to Verify to confirm the mount and test read/write access.