How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2
#Note: If you are using CentOS 4, it’s the same general process. You might have more difficulty finding the packages to install fuse and dependencies.
This is a simple guide on how to mount your S3 bucket as a “virtual drive”. This is great for backing up your data to S3, or downloading a bunch of files from S3.
#First, make sure you have the fuse package installed.
#On CentOS, fuse is available from RPMforge
#http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
#Now install fuse
yum install fuse
modprobe fuse
#Download s3fs and make
cd /usr/local/src
wget http://s3fs.googlecode.com/files/s3fs-r191-source.tar.gz
cd s3fs
make
#Copy the binary to /usr/local/bin (or wherever you prefer)
cp s3fs /usr/local/bin
#Make a mount point
mkdir /mnt/s3drive
#Mount your bucket like this:
s3fs bucketname -o accessKeyId=XXXXXXXXXXXXXXXXXXXX -o secretAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /mnt/s3drive
That’s it ! You can change directory to your virtual drive or start copying files !
Go ahead and use a visual client such as CyberDuck or S3Hub to verify with your own eyes that this actually worked. ![]()
Good luck!

Hello,
Thanks for the tutorial, yet something is missing.
In step (#Download s3fs and make)
You need to untar the downloaded archive before making, right
Best wishes
Ruslan Abuzant
11 May 10 at 3:55 pm
One more comment, you can combine my 2 comments if you wish.
libxml2 and curl libraries are needed to compile. They can be installed like this:
yum install curl*
yum install libxml2*
Have a nice day
Ruslan Abuzant
11 May 10 at 3:59 pm
yup that seems to be the accepted way however on 2 VM’s of CENTOS 5 and 1 VPS all I ever get after mounting is:
[root@xxxxxxx mnt]# ls
ls: reading directory .: Input/output error
it may also be worth mentioning to people who do not know better that you need to actualy create a bucket first in the AWS panel and with the latest versions of curl 7.20+ i belive you need to add a link to libcurl.so.4 e.g.
ln -s /usr/local/lib/libcurl.so.4 /usr/lib/libcurl.so.4
I am guessing I am doing somthing really simple wrong but I just cant figure it out this has had be beat for hours.
backtogeek
25 Jun 10 at 10:58 am
@backtogeek :
Did you install curl and curl-devel via yum ? (yum install curl*)
Qug
25 Jun 10 at 11:29 am
Hi, I’m Dan, a developer for s3fs. There have been a few changes to the project since this blog was written, please stop by and check out what’s new:
http://code.google.com/p/s3fs/wiki/FuseOverAmazon
One item in particular is the source now comes packaged in a standard GNU-type (autotools) package: configure, make and install
Dan Moore
6 Nov 10 at 8:19 pm
[...] can find the complete process of how to do it here and here remember that in centOS system you need to install this dependencies: yum install curl* yum install [...]
How to set up a backup system with R3sync and amazon S3 | Shadow Blog
19 Nov 10 at 3:52 pm
[...] i’m trying to set up a backup system with s3fs and the amazon s3 service. i followed this 2 guides: http://qugstart.com/blog/linux/how-to-mount-an-amazon-s3-bucket-as-virtual-drive-on-centos-5-2/ [...]
s3fs Input/output error
21 Nov 10 at 1:10 pm
[...] i’m trying to set up a backup system with s3fs and the amazon s3 service. i followed this 2 guides: http://qugstart.com/blog/linux/how-to-mount-an-amazon-s3-bucket-as-virtual-drive-on-centos-5-2/ [...]
s3fs Input/output error | Coding Answers
26 Apr 11 at 12:34 pm
http://jackal777.wordpress.com/2011/05/12/mount-amazon-s3-bucket-as-a-local-filesystem-in-rhel5/
Reynold
14 May 11 at 11:29 am
VPS really are a must-have item nowadays for me. Thanks for the details.
Theodore Zoquier
7 Jan 12 at 2:21 pm