Articles


How To Mount Amazon s3 Buckets In Ubuntu

How To Mount Amazon s3 Buckets In Ubuntu



Posted bynitheesh,30th Jul 2016

Amazon s3 is a web service and have online file storage facility.  Amazon S3 provides storage through web services interfaces (REST, SOAP, and BitTorrent). Amazon launched S3, its first publicly available web service, in the United States in March 2006 and in Europe in November 2007.

Steps for installation

1. Install the dependencies

sudo apt-get install build-essential gcc make automake autoconf libtool pkg-config intltool libglib2.0-dev libfuse-dev libxml2-dev libevent-dev libssl-dev

2. After the command, download riofs. 

riofs is a filesystem for mount the Amazon s3.

wget https://github.com/skoobe/riofs/archive/master.zip

 

3. Extract the file

tar xvzf riofs-master.zip

After the command you must find the "riofs-master" folder.

4. If you find it, then enter the "riofs-folder" folder and compile it

cd riofs-master

./autogen.sh

./configure

make

sudo make install

Mount Amazon s3

1. Open the terminal and configure the configuration file for riofs

mkdir ~/.config/riofs

sudo cp /usr/local/etc/riofs.conf.xml ~/.config/riofs/riofs.conf.xml

This will copy the default configuration file to your local folder. You can change the destination folder if you want to.

Add the security credential to the configuration file

nano ~/.config/riofs/riofs.conf.xml

Scroll down the page till you see the AWS_ACCESS_KEY section.

Uncomment that section and replace "###AWS_ACCESS_KEY###" with your access key and "###AWS_SECRET_ACCESS_KEY" with the secret key.

Save (Ctrl + o) and exit (Ctrl + x).

2. Change the permission for the riofs.conf.xml file.

chmod 600 ~/.config/riofs/riofs.conf.xml

3. Create a directory (preferably in your Home folder) that you can mount Amazon S3 to.

mkdir ~/S3

4. Lastly, mount your Amazon S3 bucket to the S3 directory.

riofs -c ~/.config/riofs/riofs.conf.xml my_bucket_name ~/S3

To check if your bucket is successfully mounted, just list all the files in the mounted directory:

ls ~/.S3