Tuesday, August 5, 2008

How to S3fs on EC2 Ubuntu

Download, build, and install (use libcurl3-openssl-dev for Ubuntu

apt-get install -y subversion build-essential libcurl4-openssl-dev
libxml2-dev libfuse-dev
svn checkout http://s3fs.googlecode.com/svn/trunk/s3fs s3fs
make -C s3fs (install g++ if needed and install make)
cp s3fs/s3fs /usr/local/bin

- Set up an S3 access configuration file

export AWS_ACCESS_KEY_ID=...
echo "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs

- Start s3fs (probably best to use a new/empty bucket the first time):

mkdir -p /mnt/$bucket
/usr/local/bin/s3fs $bucket /mnt/$bucket

- Shut it down (flushes any cached data)

umount /mnt/$bucket

s3fs has a caching mechanism: You can enable local file caching to minimize downloads, e.g., :

/usr/bin/s3fs mybucket /mnt -ouse_cache=/tmp

AddThis Feed Button


Anuj said...

Thanks for the post. Thats a nice piece of information i must say.It really helped me.

John Turner said...

do if I have to sudo to do all these commands? thx

Aurobindo said...

yeah.. atleast i always used to do so..

mjnet said...

Thanks for the post.

In my case, I can't read/write directories. Is this also a known issue for you? (using ec2 ubuntu 11.1 too)