Angelo's Soapbox

Monday Jan 12, 2009

Mounting Amazon S3 buckets as a file system on OpenSolaris

Happy New Year.

Recently, I have been trying to make Amazon S3 buckets more "accessible" on my OpenSolaris system. My goal was to "mount" an S3 bucket as a filesystem on OpenSolaris.

I came upon s3fs a filesystem in userspace (FUSE) that uses the Amazon S3 as its data store. Last week I spent a few minutes building s3fs on OpenSolaris.Here are the step by step instructions.

Summary Instructions


Details
  • Building fusefs & libfuse on OpenSolaris
    Install needed pkgs

    Download, build and install Open Solaris version of fusefs and libfuse
    • hg clone ssh://anon@hg.dot.opensolaris.org/hg/fuse/fusefs
    • hg clone ssh://anon@hg.dot.opensolaris.org/hg/fuse/libfuse
    • Read the INSTALL doc for instructions on building and installing fusefs. Here are a few Gotcha's.
      • Make sure to use make and not gmake
      • Add /opt/onbld/bin/i386 to the path
      • cd into fusefs/kernel
      • make
      • make pkg
      • pfexec pkgadd -d packages SUNWfusefs
      • pfexec bootadm update-archive
      • reboot
    • Read the INSTALL doc for instructions on building and installing libfuse.
      • cd libfuse
      • make install
      • make pkg
      • pkgadd -d packages SUNWlibfuse

  • Download and build s3fs

  • Using s3fs
    • First make sure you have an AWS account.
    • Create or reuse an S3 bucket you already have. another-s3-bash is an excellent tool for this purpose. It works well on OpenSolaris. The rest of the instructios assume that you are using another-s3-bash
    • Set up env variables for another-s3-bash
      • export S3_ACCESS_KEY_ID="your access key"
      • echo -n "your secret key" > secret-key.txt
      • export S3_SECRET_ACCESS_KEY=secret-key.txt
    • Create a bucket on S3
      • s3 put fusebucket
    • Put something in the fusebucket
      • echo "Hello S3 World" > /tmp/hello
      • s3 put fusebucket:hello /tmp/hello
    • Mount the S3 bucket
      • s3fs fusebucket /mnt
    • Use it
      • cd /mnt
      • You can do normal filesystem operations like, ls, cp, mv chmod etc
    • s3fs logs everything using syslog. So if you need to see messages look at /var/adm/messages

Hope this helped. Let me know if you have issues. More to come on this front.

Comments:

any chance this will be patched into opensolaris and get a nice & clean gui at some point?! would be pretty killer!

Posted by bro on January 12, 2009 at 02:41 PM EST #

[Trackback] A while ago, i speculated about a combination of SamFS and a cloud storage service in SamFS at home. Yesterday i�ve read Angelos article about mouting Amazon S3 Buckets in OpenSolaris. You have to take into consideration, that SamFS on-disk archiving i...

Posted by c0t0d0s0.org on January 13, 2009 at 01:31 PM EST #

Post a Comment:
  • HTML Syntax: NOT allowed


  Free Tech Webinars  

Archives
Links
Referrers