Skip to content

Mount a bucket with s3fs

View as Markdown

s3fs-fuse mounts a bucket as an ordinary folder, so anything on your system that reads and writes files can use it without knowing it is talking to E2E Object Storage underneath. You need a bucket and an access key first; see Generate an access key. You also need a Linux or macOS computer to mount it on: a node you create in MyAccount, or your own machine.

sudo apt install s3fs

On RHEL or CentOS, install it from EPEL instead:

sudo yum install epel-release
sudo yum install s3fs-fuse

On macOS, s3fs needs osxfuse, the add-on that lets macOS mount a folder that is not on a local disk. Install it first, then s3fs, both with Homebrew:

brew install --cask osxfuse
brew install s3fs
echo "<access-key>:<secret-key>" > /etc/object-storage-creds
chmod 600 /etc/object-storage-creds

The permission change limits the file to your own user, since it holds your secret key in plain text.

Create a folder to mount it at, then mount it:

mkdir /object-storage
s3fs <bucket-name> /object-storage -o passwd_file=/etc/object-storage-creds,use_path_request_style,url=https://objectstore.e2enetworks.net

Use the Chennai endpoint from S3 compatibility instead of https://objectstore.e2enetworks.net if your bucket is in Chennai. Confirm it mounted:

mount | grep s3fs

A successful mount looks like this:

s3fs on /object-storage type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)

To confirm the mount reaches the bucket itself, write a test file through it, then look for that file in the bucket:

touch /object-storage/s3fs-test-file

Then look for s3fs-test-file in the bucket from Object Storage in MyAccount, or with another client such as s3cmd or mc.

Files you copy into /object-storage now appear as objects in the bucket, and objects already in the bucket appear as files in /object-storage.

To unmount the bucket, for example before you change its keys, run umount /object-storage.

For scripted transfers without a mounted folder, see Connect with the mc client; it is the simpler tool.