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

Archive for the ‘s3’ tag

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 , , , , ,