How to mount object storage container as file system using goofys (Linux)?

If you want to create new Object Storage container you may check following guide: LINK

To mount your Object Storage container as file system do following steps:

For Ubuntu:

$ sudo add-apt-repository ppa:gophers/archive && sudo apt-get update && sudo apt-get install golang-1.10-go

$ echo "export PATH=$PATH:/usr/lib/go-1.10/bin" >> ~/.profile

$ source ~/.profile

$ export GOPATH=$HOME/work && go get github.com/kahing/goofys && go install github.com/kahing/goofys


For Centos:

$ sudo rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO

$ curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo

$ sudo yum install golang


Next, create file ~/.aws/credentials with content:

[s3]
aws_access_key_id=XXXX
aws_secret_access_key=XXXX


To obtain s3 credentials (Access Key and Secret Key), that are generated on our part, please contact us via email or create Support ticket.

 

After creating the credentials file you may mount your container:

 

$ $GOPATH/bin/goofys --region RegionOne --profile s3 --endpoint https://cf2.cloudferro.com:8080/ \
cont ~/new
Hint:
Store ec2 credentials in root home directory if you use goofys with sudo.

In example above, cont is the name of the container, and ~/new is an example mount point.

 

Additional parameters:

-o allow_other:         Assure access to your bucket for other users.
--file-mode value       Permission bits for files. (default: 0644) (default: 420)
--dir-mode value        Permission bits for directories. (default: 0755) (default: 493)
--uid value             User ID owner of all inodes. (default: 1000)
--gid value             Group ID owner of all inodes. (default: 1000)

 

Warning:
If you create a mount point as a non-root user you have to proceed some changes in
the /etc/fuse.conf file.

Open this file and locate the line:
# user_allow_other

Uncomment it, by deleting the # sign at the beginning:
user_allow_other

Save a configuration.

To check the user type please gather information in /etc/sudoers.