S3FS-FUSE
Learn how to use S3FS-FUSE with Filebase.
What is S3FS-FUSE?
S3FS-FUSE is a tool that enables Linux and macOS X operating systems to mount an S3 bucket via a Filesystem in USErspace (FUSE). S3FS-FUSE preserves the object’s native format which allows for utilizing other tools like AWS CLI with buckets mounted via S3FS-FUSE.
S3FS-FUSE is certified for use with Filebase. Read below for instructions on how to configure and mount a Filebase bucket using S3FS-FUSE.
This guide was tested and written using Ubuntu 20.04. Commands may vary based on your operating system and version.
1. Set up Access Keys.
If you already have AWS CLI installed and configured for use with Filebase, you can use the credentials file used by AWS CLI. This file is stored at ${HOME}/.aws/credentials
.
Otherwise, you can set up a credentials file for S3FS at ${HOME}/.passwd-s3fs
.You will need to save your Filebase Access and Secret keys to this file and give it owner permissions. You can do so with the following commands:
echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ${HOME}/.passwd-s3fs
chmod 600 ${HOME}/.passwd-s3fs
ACCESS_KEY_ID is your Filebase Access key, and SECRET_ACCESS_KEY is your Filebase Secret key.
2. Mount your bucket.
You can mount a Filebase bucket with the command:
s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs -o url=https://s3.filebase.com
mybucket: name of your Filebase bucket
/path/to/mountpoint: the path where you want the bucket mounted.
3. Confirm the bucket has been mounted.
We can view the files within the mount directory and confirm that they are the same files as in the bucket.
4. Any files moved into this directory and will get uploaded to the Filebase bucket.
In this example, we’ve copied the file file.jpg
to the bucket’s mounted directory, and then viewed the contents of the directory to confirm it had been copied.
cp file.jpg /home/filebase/mount
ls /home/filebase/mount
5. Confirm the file has been uploaded by viewing the bucket in the Filebase web console.
For more information on S3FS-FUSE, check out their GitHub here.
Last updated