Frequently Asked Question
How to mount Oracle Object Storage as local filesystem in Linux
Last Updated 3 years ago
There may be a requirement to access object storage on Oracle cloud as a local filesystem on Linux. This shall be accessible using posix interface. This can achieved using s3fs.
1. Create a bucket under objectstorage. Assuming the bucket name to be bucket_s3fs. 2. Note down the namespace for the bucket. Let us assume this to be axb1fas123cde. This can be located objectstore console, bucket information. 3. Create an account for s3 access under identity. Let this user be s3user 4. Create a group for s3 access - s3admins. Make the user s3user part of this group 5. Create a policy and add the following privileges to it "Allow group s3admins to manage buckets in tenancy" & "Allow group s3admins to manage objects in tenancy" 6. Create an access key and secret key for the user s3user. This should be done in Identity->Users->Customer Secret Keys 7. Save the keys in the format access_key:secret_key in file passwd_s3fs in the home directory of the linux user 8. In the linux system, install s3fs. In Centos or Oracle Linux use 'yum install s3fs-fuse' In Ubuntu use 'apt install s3fs' 9. Create a mount point mountdir 10. Run the command as follows s3fs bucket_s3fs mountdir -o passwd_file=/path/to/passwd_s3fs -o endpoint=ap-hyderabad-1 -o url=https://axb1fas123cde.compat.objectstorage.ap-hyderabad-1.oraclecloud.com/ -onomultipart -o use_path_request_style 11. To make the selection permanent - make entry in /etc/fstab as follows #s3fs bucket_s3fs /path/to/mountdir fuse.s3fs _netdev,allow_other,nomultipart,use_path_request_style,passwd_file=/path/to/passwd_s3fs,url=https://axb1fas123cde.compat.objectstorage.ap-hyderabad-1.oraclecloud.com/ 0 0