- Newest
- Most votes
- Most comments
The issue you're experiencing with writing to your mounted S3 bucket is likely due to the read-only nature of Mountpoint for Amazon S3. By default, Mountpoint for Amazon S3 mounts buckets in read-only mode.
Looking at your error message "Input/output error" when trying to write a file, this is consistent with attempting to write to a read-only mount. Even though you've specified the "rw" option in your fstab configuration, Mountpoint for S3 doesn't support write operations in the same way traditional filesystems do.
When applications try to overwrite existing files on a Mountpoint for S3 mount, the operation fails with errors similar to what you're seeing. The logs would typically show a warning message indicating that the inode is not writable.
To resolve this issue:
- Check your IAM permissions - ensure the EC2 instance role has proper S3 permissions (s3:PutObject) for the bucket
- If you need write capabilities to S3, consider using AWS CLI commands (aws s3 cp) or SDK operations instead of filesystem operations through the mount
- Alternatively, you could use a different S3 mounting solution that supports write operations
The "nodev" option in your fstab configuration is not causing this issue - it's related to preventing device file interpretation on the mounted filesystem.
Sources
Troubleshooting Mountpoint - Amazon Simple Storage Service
Lamba write to s3 not working unless with FullAccess iam role | AWS re:Post
The answer was the EC2 Instance Profile only had read from the s3 bucket in question. I was so focused on the "newness" of mount-s3 and /etc/fstab that I missed the underlying instance profile. Problem resolved.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
