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 $ mkdir work $ 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://https://s3.waw2-1.cloudferro.com/ \ CONTAINER-NAME ~/MOUNT-POINT
Store ec2 credentials in root home directory if you use goofys with sudo.
According to the example above, you have to provide CONTAINER-NAME and MOUNT-POINT in an proper order.
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)
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.
Example configuration in /etc/fstab (additionally):
/home/eouser/work/bin/goofys#/container /mountpoint fuse _netdev,allow_other,--dir-mode=0777,--file-mode=0666,--region=RegionOne,--profile=s3,--endpoint=https://https://s3.waw2-1.cloudferro.com 0 0