How to Mount an Amazon S3 Bucket as a Drive with S3FS

RajatRajat
1 min read

Table of contents

  • Installation steps for Ubuntu:

On Ubuntu 16.04, using apt-get, it can be installed by using the command below:

sudo apt-get install s3fs

Step 2: Configuration

1. Once S3FS is installed, set up the credentials as shown below:

echo ACCESS_KEY:SECRET_KEY > ~/.passwd-s3fs
cat ~/ .passwd-s3fs ACCESS_KEY:SECRET_KEY

Snapshot as example

You will also need to set the right access permission for the passwd-s3fs file to run S3FS successfully. To do that, run the command below:

chmod 600 .passwd-s3fs

2. Now we’re ready to mount the Amazon S3 bucket. Create a folder the Amazon S3 bucket will mount:

mkdir ~/s3-drive
s3fs <bucketname> ~/s3-drive

You might notice a little delay when firing the above command: that’s because S3FS tries to reach Amazon S3 internally for authentication purposes. If you don’t see any errors, your S3 bucket should be mounted on the ~/s3-drive folder. To verify if the bucket successfully mounted, you can type “mount” on terminal, then check the last entry, as shown in the screenshot below:

Screen Shot 2018-05-08 at 3.29.42 PM

l

0
Subscribe to my newsletter

Read articles from Rajat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rajat
Rajat

I'm a DevOps enthusiast from India, eager to learn and grow. Despite being a fresher, I've gained hands-on experience with AWS, Docker, Kubernetes, RHCSA, and CI/CD, and completed some Udemy courses. I'm always open to new insights and connections in the DevOps community. Let's connect!