How to Mount Object Storage Container as File System Using goofys For Linux on CREODIAS

In this tutorial, you will mount your object storage container as a file system either

  • on a virtual machine or

  • on your personal computer running Ubuntu 20.04 LTS.

What We Are Going To Cover

  • Downloading goofys

  • Authenticating

  • Mounting an Object Storage Container

  • Mounting an Object Storage Container automatically at startup

Prerequisites

No 1. Hosting

You need a CREODIAS hosting account with Horizon interface https://horizon.cloudferro.com.

No 2. An object storage container

Creating an object storage container is desribed in the following article: How to use Object Storage on CREODIAS.

No 3. Your EC2 credentials

You need to obtain EC2 credentials as described in the following article: How to generate and manage EC2 credentials on CREODIAS.

No 4. Computer on which you will mount your container

You will need a virtual or physical machine running on Ubuntu 20.04 LTS. You can use your own computer or create a virtual machine on the CREODIAS cloud as described in the following article: How to create new Linux VM in OpenStack Dashboard Horizon on CREODIAS.

Step 1: Download goofys

Warning

The method of obtaining goofys described in this article does not include automatic updates. If there is a new release of this piece of software, you will need to remove the previous version and use wget to download it manually. This is a relatively simple process because the goofys binary is just one file.

First, update your system and install wget.

sudo apt update && sudo apt upgrade && sudo apt install wget

Now, navigate to your home directory, download the goofys binary using wget and make it executable:

cd
wget https://github.com/kahing/goofys/releases/latest/download/goofys
chmod +x goofys

Create the folder for storing your credentials.

mkdir ~/.aws/

Step 2: Authenticate

If you do not have your access key and secret key, you will need to obtain them by following this article: How to generate and manage EC2 credentials on CREODIAS.

Create the file ~/.aws/credentials using your favourite text editor, for example:

nano ~/.aws/credentials

Enter the following content to that file (replace 1234 and 4321 with your access key and secret key, respectively):

[s3]
aws_access_key_id=1234
aws_secret_access_key=4321

Step 3: Mount your object storage container

Create a directory which will be the mountpoint for your container, for example:

mkdir ~/storage

Now mount your container using the following command:

./goofys --region WAW3-1 --profile s3 --endpoint https://s3.waw4-1.cloudferro.com box ~/storage

Explanation of the parameters:

  • ./goofys is the location of the goofys binary you downloaded,

  • box is the name of your container and

  • ~/storage is the location of the folder in which you want your container.

Mounting the bucket each time the operating system starts

If you want to have your bucket mounted automatically each time the operating system starts, first copy your credentials to your root folder:

sudo mkdir /root/.aws
sudo cp ~/.aws/credentials /root/.aws/

Now, add the following line to the file /etc/fstab

/home/eouser/goofys#box /home/eouser/storage fuse _netdev,allow_other,--dir-mode=0777,--file-mode=0666,--region=WAW4-1,--profile=s3,--endpoint=https://s3.waw4-1.cloudferro.com 0 0

where the parameters are:

  • /home/eouser/goofys is the goofys binary you downloaded,

  • box is the name of your container and

  • /home/eouser/storage is the location in which you wish to mount your container.

Additional Information

For more information on using goofys, execute its binary with the –help option:

./goofys --help