Script to create storage on AWS

Install latest fuse release
Start first by removing existing fuse packages installed on your system.

yum remove fuse fuse* fuse-devel
Install development tools and required packages if you don't already have them.

yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap
Download, compile and install fuse. Use this link to get the latest fuse release.

mkdir -p /tmp/compile && cd /tmp/compile
wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.6/fuse-2.8.6.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffuse%2Ffiles%2Ffuse-2.X%2F&ts=1324112754&use_mirror=freefr
tar -zxf fuse-2.8.6.tar.gz
cd fuse-2.8.6
./configure --prefix=/usr
make
make install
Update ldconfig

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
Load fuse module and confirm we use our compiled version

modprobe fuse
pkg-config --modversion fuse (should return 2.8.6)
Cleanup a bit...

cd /tmp/compile
rm -rf fuse*
Install s3fs

Now that prerequisite are satisfied, it is time to download, compile and install s3fs. Browse to repository to get the link of the latest s3fs release.

cd /tmp/compile
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar -zxf s3fs-1.61.tar.gz
cd s3fs-1.61
./configure --prefix=/usr
make
make install
Again some cleanup...

cd /tmp/compile
rm -rf s3fs*
Using s3fs
Time to test our installation. First, we need to create a credential file to connect to our s3 bucket. Replace bucketName, accessKeyId and secretAccessKey with your own.

cat << EOT > ~/.passwd-s3fs
bucketName:accessKeyId:secretAccessKey
EOT
chmod 600 ~/.passwd-s3fs
Finally, use this command to mount your bucket, replacing bucketName and mountpoint by your own parameters.

s3fs bucketName mountpoint -ouse_cache=/tmp

Comments

Popular posts from this blog

Push command for NetWorker Client Upgrade

Factors Affecting Users’ Sense of Security and Trust in Integrating Electronic health record to the cloud

Basic Elastic Cloud Storage Troubleshooting Commands