Rss Feed Tweeter button Facebook button Technorati button Reddit button Linkedin button Webonews button Delicious button Digg button Flickr button Stumbleupon button Newsvine button

A Waage Blog

Ruby, Rails, Life

How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2

with 12 comments

#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!

Written by Andrew Waage

April 6th, 2010 at 6:38 pm

Posted in Amazon Web Services, linux

Tagged with , , , , ,

12 Responses to 'How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2'

Subscribe to comments with RSS or TrackBack to 'How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2'.

  1. 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

  2. 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

  3. 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

  4. @backtogeek :
    Did you install curl and curl-devel via yum ? (yum install curl*)

    Qug

    25 Jun 10 at 11:29 am

  5. 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

  6. [...] 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 [...]

  7. [...] 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/ [...]

  8. [...] 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/ [...]

  9. Reynold

    14 May 11 at 11:29 am

  10. This appears to be working – I have a mount point appearance on my local Centos box and I can even create files and directories under that mount point. But when I login to my AWS console and look in S3 there – nothing is showing up. I checked it with Cyberduck from my local computer and it doesn’t see anything that my local Centos box sees. Any thoughts?

    Thanks – Brian

    Brian Jones

    1 Nov 11 at 10:29 am

  11. VPS really are a must-have item nowadays for me. Thanks for the details.

  12. You’re a saint; you’re a scholar. I’ve been fighting with s3fs for a couple days now and this worked for me. Thanks!

    Trevor

    10 Sep 12 at 1:02 pm

Leave a Reply