Monday, January 11, 2021

how to mount S3FS in ubuntu

S3FS is a Filesystem interface to Amazon S3 cloud storage. As a PyFilesystem concrete class, S3FS allows you to work with S3 in the same as any other supported filesystem.

 Create IAM user for accessing S3FS

 Step 1 ) Click on services >> write IAM

 

 Step 2) Click on User 

Step 3) Click on Add User

Step 4) write the user name >> Click on Programmatic access >> Click on Next

Step 5) Click on Attach exsisting polices >> Write the s3 >> tick on AmazonS3FullAccess >> Click on next

Step 6) Write the Add tags

Step 7) Review The User Details >> click on create user

Step 8) Download the .csv file 

 

Create S3 bucket_____________________________


Step 1) click on Services > write s3

Step 2) Click on create bucket 

Step 3) Write the bucket name 

Step 4) Untick on Block all public access >> tick on Turning off block all public access >> Click on create bucket

Step 5) Click on bucket name 

Step 6) Click on create folder and create test folder 


Access ubuntu terminal via ssh



Step 1) Remove Exsisting Package Of Fuse

sudo apt-get remove fuse

Step 2) install Required Packages

sudo apt-get install build-essential libcurl4-openssl-dev libxml2-dev mime-support pkg-config libssl-dev libfuse-dev automake

Step 3) Download and Compile Fuse

$ sudo su

$ cd /usr/src/

$ sudo wget https://github.com/libfuse/libfuse/releases/download/fuse-3.0.0/fuse-3.0.0.tar.gz

$ sudo tar xzf fuse-3.0.0.tar.gz

$ cd fuse-3.0.0

$ ./configure --prefix=/usr/local

$ make && make install

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

$ ldconfig

$ modprobe fuse


Step 4) Download And Compile S3FS


$ git clone https://github.com/s3fs-fuse/s3fs-fuse.git

$ cd s3fs-fuse

$ ./autogen.sh

$ ./configure

$ make

$ make install


Step 5) Setup AWS Access key and Secret key


note:- copy AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from .csv file, while creating IAM user

echo AWS_ACCESS_KEY_ID:AWS_SECRET_ACCESS_KEY > /etc/aws-s3fs

Step 6) Give Permission To File

chmod 600 /etc/aws-s3fs

Step 7) Create Mount-Point folder

mkdir BackupFolder

chmod 777 BackupFolder


Step 8) Temporary Mount S3 To Mount-Point

sudo s3fs mytestings3fsbucket /home/ubuntu/BackupFolder -o passwd_file=/etc/aws-s3fs

For no empty folder_

sudo s3fs mytestings3fsbucket /home/ubuntu/BackupFolder -o passwd_file=/etc/aws-s3fs -o nonempty

 

Permanent mount point ---------

 

Step 1) Install fuse file-system

sudo apt-get install fuse

Step 2) Edit fstab file and add below line with modify 

vim /etc/fstab

s3fs#mytestings3fsbucketh /home/ubuntu/BackupFolder fuse _netdev,allow_other 0 0

Step 3) Mount the filesystem which is entry on fstab

sudo mount -a

Step 4) Reboot the System and check mounted point exixt.







No comments:

Post a Comment

testing