Skip to content

EC2 — Mount

Progress checklist

Run all commands in this page inside the SSM session on the EC2 instance. Start a session from your workstation if not already connected:

Terminal window
aws ssm start-session \
--target "$INSTANCE_ID" \
--region "$AWS_REGION"
  1. Install amazon-efs-utils v3.0.0 or newer. Required

    S3 Files requires the updated amazon-efs-utils package that ships with the s3files mount type support. Run on the instance:

    Terminal window
    sudo dnf install -y amazon-efs-utils

    Confirm the installed version is 3.0.0 or newer:

    Terminal window
    rpm -q amazon-efs-utils
  2. Set the file system ID in the session. Required

    Export FS_ID inside the SSM session so the mount command can reference it:

    Terminal window
    export FS_ID=fs-0123456789abcdef0 # ← replace with the ID from Setup
    echo "FS_ID=$FS_ID"
  3. Create the mount point. Required

    Terminal window
    sudo mkdir -p /mnt/s3files
  4. Mount the file system. Required

    Terminal window
    sudo mount -t s3files "${FS_ID}:/" /mnt/s3files

    Allow the ssm-user to read the mount root without sudo:

    Terminal window
    sudo chmod 755 /mnt/s3files
  5. 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/fstab

    Verify the entry was written correctly:

    Terminal window
    grep s3files /etc/fstab

Continue to Verify to confirm the mount and test read/write access.