Skip to content

Instantly share code, notes, and snippets.

@ymek
Created September 22, 2015 22:14
Show Gist options
  • Save ymek/91da2bfbe9e11dcd27ec to your computer and use it in GitHub Desktop.
Save ymek/91da2bfbe9e11dcd27ec to your computer and use it in GitHub Desktop.
Mount s3 as a filesystem on Amazon Linux
# NOTE: the majority of these commands should be run as root
# install dependency packages
yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel openssl-devel mailcap autoconf automake
mkdir -p $HOME/src
cd $HOME/src
# download/extract the latest source tarball
wget https://github.com/s3fs-fuse/s3fs-fuse/archive/master.tar.gz
tar -zxf master.tar.gz
# build and install s3fs-fuse
cd s3fs-fuse-master
./autogen.sh
./configure --prefix=/usr
make
make install
# set up AWS credentials
echo "YOUR_AWS_ACCESS_KEY_ID:YOUR_AWS_SECRET_ACCESS_KEY" >> /etc/passwd-s3fs
chmod 640 /etc/passwd-s3fs
# mount our s3 bucket(s)
# NOTE: add this to /etc/rc.local or make an entry in/etc/fstab for production use
/usr/bin/s3fs [your_bucket_name] [/path/to/mount/point] -o default_acl=public-read -o use_cache=/tmp -o del_cache -o allow_other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment