Back to the main page
Mounting OCI Object Storage Bucket as File System
This has been tested on Oracle Linux 7.
It's done using s3fs-fuse, that allows OL to mount OCI (Oracle Cloud Infrastructure) bucket via FUSE.
The FUSE allows implementation of fully functional filesystem in a userspace program.
Create OCI object storage bucket
For example, via OCI console, make standard one, named bucket2fs.
And upload some file.
Install s3fs on OL7
Install this on a system that will mount a bucket.
yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/s/s3fs-fuse-1.85-1.el7.x86_64.rpm
The system mounts bucket using credentials. Same credential file can be used on multiple systems.
Generate secret key:
In OCI console - User Settings - Click Customer Secret Keys - click Generate Secret Key.
Give name, for example s3fs-mount
Copy and save the secret key because it won't be shown again.
The S3 credentials are created by using an access key and the secret key. The access key is displayed in the Customer Secret Keys area of the Console.
Save credentials in OL7, in the file /root/.s3fs-password (root:root 600), file example:
Mount file system
For example, create /u01 and mount object storage bucket.
Since this is OCI object storage, options in below commands are mandatory (in case of AWS, they can be omitted).
Note that URL is https://<tenancy>.compat.objectstorage.<region>.oraclecloud.com
If you want mount to be persistent over reboot, better adding the line in /etc/fstab
# s3fs bucket2fs /u01 -o passwd_file=/root/.s3fs-password -o url=https://<my-tenancy>.compat.objectstorage.<my-region>.oraclecloud.com/ -o nomultipart -o use_path_request_style
# ls -la /u01
drwx------ 1 root root 0 Dec 31 1969 .
dr-xr-xr-x. 32 root root 4096 Aug 15 15:05 ..
-rw-r----- 1 root root 884998144 Aug 15 14:25 OVS-3.4.4-1709.iso
# mount | grep /u01
s3fs on /u01 type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
This can be done on any systems that mount a bucket.
bucket2fs /u01 fuse.s3fs nomultipart,use_path_request_style,passwd_file=/root/.s3fs-password,url=https://<my-tenancy>.compat.objectstorage.<my-region>.oraclecloud.com/
OCI object storage can be of two types:
frequently accessed "hot" storage (Object storage), and less frequently accessed "cold" storage (Archive storage).
There is potential of on premises system to mount and use it, instead of NFS share, or additional local or iSCSI disks.
- Use Object Storage for data to which you need fast, immediate, and frequent access, examples can be backup, logs, repositories.
- Use Archive Storage for data to which you seldom or rarely access, but that must be retained and preserved for long periods of time.
Some of them are:
- no hard links
- concern about coordination between multiple clients mounting the same bucket,
although vi of a file in one client creates swap file, hence other clients are prevented of editing same file.
Back to the main page