Follow the steps given below to mount s3 to the ec2 instance
apt-get update
sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
- Clone s3fs source code from git
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
- Run the below commands to change the source code directory, and compile and install the code.
cd s3fs-fuse
autogen.sh
./configure --prefix=/usr --with-openssl
make
sudo make install
- Run the s3fs command to check where the command is placed
which s3fs
- Get your access key and secret key ready.
- Create a new file in /etc with the name passwd-s3fs and paste your access key and secret key.
touch /etc/passwd-s3fs
vim /etc/passwd-s3fs
Your_accesskey:Your_secretkey
- Change the permission of the file
sudo chmod 640 /etc/passwd-s3fs
- Now create a directory or provide the path of an existing directory and mount S3bucket in it.
mkdir /mys3bucket
s3fs your_bucketname -o use_cache=/tmp -o allow_other -o uid=1001 -o mp_umask=002 -o multireq_max=5 /mys3bucket