π§ AWS just made it easier to auto-mount S3 buckets on EC2 instances using fstab and Mountpoint for Amazon S3!
Amazon recently announced that Mountpoint for Amazon S3 now supports automatic mounting via the Linux fstab file. This is a game-changer if you're tired of manually remounting S3 buckets every time your EC2 instance reboots.
π Whatβs New?
Previously, using Mountpoint for S3 meant:
- Running mount-s3 manually after every reboot
- Reconfiguring mount options every time
- Risk of misconfiguration
Now, with the fstab integration, your instance can automatically mount S3 buckets on startupβjust like an EBS volume or NFS share. π
π§ͺ Step-by-Step Example
Letβs walk through a simple example to see how this works.
π οΈ Prerequisites
- Mountpoint for Amazon S3 is installed
- Your instance IAM role has S3 access
- You have an S3 bucket, e.g., my-s3-bucket
β
1. Create the Mount Directory
sudo mkdir -p /mnt/my-bucket
β 2. (Optional) Test Manual Mount
Try mounting it manually first to verify access:
sudo mount-s3 my-s3-bucket /mnt/my-bucket
If you can list files inside /mnt/my-bucket, youβre good!
β 3. Add Entry to /etc/fstab
Open the file:
sudo nano /etc/fstab
Add the following line:
my-s3-bucket /mnt/my-bucket s3 _netdev,allow_other 0 0
β οΈ Make sure to replace s3 with the actual filesystem type used by Mountpoint (typically just s3).
β 4. Test It!
Run:
sudo mount -a
No errors? Then it's working! π Your S3 bucket will now auto-mount on every reboot.
π§ Why It Matters
This small addition simplifies infrastructure management:
πΎ Persistent S3 access
βοΈ Better for automation and scripting
π Useful for containers, EC2 fleets, and bootstrapping
Have you tried it yet? Let me know how youβre using Mountpoint in your workflow! ππ
Top comments (0)