Mount Amazon S3 bucket as a local filesystem in Linux RHEL5
The steps to mount an s3 bucket as a local filesystem is given below. This has been tested in i386 machine running RHEL 5.6 (Tikanga). There are two restrictions which cannot be overridden,
ONE: Maximum file size=64GB (limited by s3fs, not Amazon).
TWO: Bucket name shouldn’t have upper case characters.
1) Install current latest FUSE( Filesystem in Userspace) package.
The rpmbuild command will create all the fuse rpms inside “/root/rpm/RPMS/i386/”. Then using rpm command install those packages
2) Install S3FS package
3) Create a symbolic link to “s3fs” binary
4) Activate an account in s3. You will get an access key and secret_key after the activation.
You can create a new s3 account by following the url,
5) Install s3 client for linux. The package name is “s3cmd-1.0.0-4.1”.
Alternatively, you can download it from the url pasted below:
6) Configure s3 client using the command,
It will ask for the access key and secret key that we got during our account activation. This process reports failure, if we provide the wrong key values. Once this step is completed, the configuration will be stored inside the file “/root/.s3cfg”.
7) We need to create buckets in s3 for mounting it locally
eg: creating a bucket named “dailybackup”,
For additional options refer the url,
8) List all buckets
9) Create s3fs password file. The s3fs password file has this format (use this format if you have only one set of credentials):
If have more than one set of credentials, then you can have default credentials as specified above, but this syntax will be recognized as well:
10) Mount the bucket “dailybackup” on directory “/amazonbackup”
I configured this setup and used it for weekly cpanel backup uploads. As the s3 bucket is mounted as a local drive, we can use rsync to move directories or files to amazon. eg:
1) s3fs has a caching mechanism: You can enable local file caching to minimize downloads, e.g., :