Welcome to OCI. Today, we are going through the steps to Mount an Object Storage Bucket
as a Filesystem in Linux Server Before you begin, ensure that
Object storage policies are added under the root compartment.
Please check the video description for the documentation. For this demo, I have used
an Oracle Linux Compute instance. Also, I have already created the
Object storage Bucket. To view it, let’s go to OCI
Console > Storage > Object Storage & Archive Storage > Buckets > name: demo_mount_bucket
We need to first create a secret key. Login to OCI account
Go to the Oracle Cloud Infrastructure Web Console, click on the Profile icon in the
top-right corner, and select User Settings.
Click Customer Secret Keys, and then click Generate Secret Key.
Give the key a name (for example, s3fs-access), and then click Generate Secret Key.
Copy and save the secret key because it won't be shown again.
The S3 credentials are created using access key and secret keys. The access key is displayed in
the Customer Secret Keys area of the Console. To confirm the Object Storage Namespace,
click on the Profile icon in the top-right corner and select Tenancy > Object storage settings >
Object storage namespace. Note: For some old tenancies,
namespace is the same as the tenancy name. Please note that they could be different.
The second step is to install “s3fs-fuse” Package.
For the ease of this demo, I have already created the Linux instance.
First connect to the OCI Linux instance. Switch to Root User run command : sudo su -
Need to Install s3fs-fuse Package on Oracle Linux.
Run Command : yum install s3fs-fuse Before installing s3fs-fuse, you need
to enable the oracle “epel” repository. Otherwise, you may hit an error like Error:
Unable to find a match: s3fs-fuse. First, enable Oracle EPEL Repository
Edit the EPEL Repository File. Press i for insert mode
Do changes In Line: Change enabled ‘0’ to enabled ‘1’.
To save press ESC key : wq! Verify the changes run
Command cat /etc/yum.repos.d/oracle-epel-ol8.repo Installing Package directly
using yum install s3fs-fuse: Run Command: yum install s3fs-fuse
Output : Installed Complete!
The third step is Configure Credentials & mounting the File System
Create password file for s3fs. Will created file in Home directory
File Path & Name: ${HOME}/.passwd-s3fs Run Command: vi ${HOME}/.passwd-s3f
Press ‘I’ for insert mode Need to put ACCESS_KEY_ID:SECRET_ACCESS_KEY
just copy & paste the generated access key and secret key, and don't forget
there is a colon between them. Give permission to file.
Run command: chmod 600 ${HOME}/.passwd-s3fs Verify the permission:
ls -ltr ${HOME}/.passwd-s3fs Now we will the Mount Bucket
Create Mount Point: Command: mkdir /mountdemobucket
Mount Bucket: Need to run the command where we need give bucket_Name,
mount_point, namespace, region s3fs -o
url=https://.compat.objectstorage..oraclecloud.com -o nomultipart -o
use_path_request_style -o endpoint= Finally, lets verify:
Run the command $df -hT Run command : df -hT /mountdemobucket
Create the test file and verify in the console Go to mount point directory : cd /mountdemobucket
Create the test.txt file using command : touch text.txt
Thanks for watching. Please contact OCI Support if you still need assistance.