Skip to content
Snippets Groups Projects
Commit eb374718 authored by Delia Passalacqua's avatar Delia Passalacqua
Browse files

Add s3fs instructions

parent 12c9a577
No related branches found
No related tags found
No related merge requests found
S3fs: mount a container as a filesystem
=================================================
Instead of `Rclone <https://cloud.garr.it/support/kb/openstack/rclone_quick_tutorial/>`_, we can use s3 APIs to connect to object storage and mount containers as filesystems. We may do this by using `s3fs <https://github.com/s3fs-fuse/s3fs-fuse>`_
Install s3fs
***************
On Ubuntu machine, you can install the packaged version with the following commands::
$ sudo apt update
$ sudo apt install s3fs
Check the version::
$ s3fs --version
N.B. These instructions refer to version 1.86 available on Ubuntu 20.04. Different versions may require different configuration.
Decomment *user_allow_other* option by removing the *#*::
$ nano /etc/fuse.conf
Create application credential
*****************************
Create and download an `application credential <https://cloud.garr.it/compute/app-credential/>`_ from openstack dashboard as *app-credentials.sh*.
Then execute the content of the file::
$ source app-credentials.sh
And create the ec2 credentials::
$ openstack ec2 credentials create -c access -c secret -f value | paste -sd: > ${HOME}/.passwd-s3fs
$ chmod 600 .passwd-s3fs
Mount a container
********************
First, you need to create the container on your openstack project. Then you can mount your container on your local directory.
Assume that you have a container named *test_container* and a local directory named *test_dir*::
$ s3fs test_container test_dir -o allow_other -o passwd_file=${HOME}/.passwd-s3fs -o host=https://swift.cloud.garr.it -o use_path_request_style -o umask=000
Now your container has been mounted on *test_dir* directory. You can access it and every change you make inside the directory is istantly made inside the container.
Debug
*****
If you need to debug, add the following options at the mounting command::
-o dbglevel=info -f -o curldbg
*Note that -f option cause the command to run in foreground, so CTRL+C will kill the command.*
Unmount
*******
::
$ umount test_dir
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment