Install S3FS and Fuse on Centos 6 RHEL and mount S3 drive on EC2

Posted on April 18, 2013

Here is a quick and dirty guide to mounting an Amazon S3 drive to your EC2 instance on Centos 6 / RHEL linux systems.

First, prepare your system and install dependencies

yum remove fuse fuse* fuse-devel
yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap

Next, install Fuse (current version at the time of this blog is 2.9.2

cd /usr/local/src
wget http://sourceforge.net/projects/fuse/files/latest/download?source=files
tar -xzvf fuse-2.9.2.tar.gz
rm fuse-2.9.2.tar.gz
mv fuse-2.9.2 fuse
cd fuse/
./configure --prefix=/usr
make
make install
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
modprobe fuse # This actually didn't work for me and displayed an error
pkg-config --modversion fuse #confirm that 2.9.2 is the version displayed

Now install S3FS

wget https://s3fs.googlecode.com/files/s3fs-1.67.tar.gz (get URL for latest version)
tar -xzvf s3fs-X.XX.tar.gz
rm s3fs-X.XX.tar.gz
mv s3fs-X.XX s3fs
cd s3fs
./configure --prefix=/usr
make
make install

Now let's test the connection to our S3 bucket. First, create a credential file to connect to our s3 bucket. Replace bucketName, accessKeyId and secretAccessKey with your own.

cat <  ~/.passwd-s3fs
bucketName:accessKeyId:secretAccessKey
EOT
chmod 600 ~/.passwd-s3fs

Finally, let's mount the S3 bucket to your filesystem

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

2 Comments

Leave a Reply

Your email address will not be published.

Contact Us

Have a question? Send us a message. We'll get back to you soon.

captcha

Share
Tweet
Pin
Share