How to access bucket using s3fs?

Another way to access the bucket is to mount it to the file system. This is a convenient solution, however, in the case of a large number of objects in a bucket, its efficiency, e.g. listing all objects, can be significantly extended, because it is based on the file system.

To use this tool, first execute bellow commands:

sudo apt update
sudo apt upgrade
sudo apt install s3fs

Then put the access and secret keys. You will receive the keys from WEkEO Support after asking to create a bucket.

sudo echo "<access_key>:<secret_key>" > ~/.passwd-s3fs
sudo chmod 600 ~/.passwd-s3fs

Then, in the /etc/fuse.conf file, remove the" # "from the "user_allow_other" line.

sudo vim /etc/fuse.conf

Then create a folder where the buket will be mounted.

sudo mkdir /mountpoint
sudo chmod 777 /mountpoint

Finally, mount the bucket.

s3fs <bucket_name> <mountpoint> -o passwd_file=~/.passwd-s3fs -o url=<dpi_url> -o use_path_request_style -o umask=0002 -o allow_other

Data such as the name of the bucket and the address where the bucket is located can be checked in the details about a given bucket.

  • <bucket_name> - you can get the bucket name from the "Bucket Name" field,
  • <dpi_url> - you can get the address where the bucket is located from the "Endpoint URL" field.

Below is an example command:

s3fs firstbucket /mountpoint -o passwd_file=~/.passwd-s3fs -o url= -o use_path_request_style -o umask=0002 -o allow_other