Search This Blog

Tuesday, August 16, 2011

s3fs

I'm very intrigued by the possibility of doing backups on Amazon S3 since they have made it free to upload data. You still have to pay for storage and download, but that should be minimal in my backup situation.

I searched for a little bit to find a suitable library to mount S3 buckets to the filesystem and came across s3fs.  To see how it works, I downloaded s3fs, compiled and configure it on my openSuSE 11.4 system.

After installing the base development pattern in YaST, I only needed to install a couple of development libraries (fuse >= 2.8.4 libcurl >= 7.0 libxml-2.0 >= 2.6) to get the configure script to run successfully. After getting the proper libraries in place,
make ran without a problem and the s3fs binary file was compiled in the src directory. Installing it to /usr/local/bin using make install as root also worked fine. 

Next, I created a bucket in AWS Management Console called rericsson-s3fs. To have something to look for in there, I uploaded a picture from the AWS console.

Following the instructions in the s3fs wiki, I created a  .passwd-s3fs file with my access credentials (be sure to have no additional whitespace in this file). After that, I ran chmod 600 ~/.passwd-s3fs to restrict permissions to the file.

To test it out, I did the following from the command line and could see the file I had uploaded:

rob@linux-oqvn:~> mkdir s3
rob@linux-oqvn:~> /usr/local/bin/s3fs rericsson-s3fs /home/rob/s3
rob@linux-oqvn:~> cd s3
rob@linux-oqvn:~/s3> ls
DSC00078.jpg

I tried a couple of more copies into the mounted directory and everything worked very well. All of this took about 30 minutes and is a promising start for backing up my system to S3.


No comments: