Skip to main content

Command Palette

Search for a command to run...

[OCI] Mount a Bucket as a FS

Published
3 min read
[OCI] Mount a Bucket as a FS

If you prefer to read in Spanish Spanish version.

Today, we are going to talk about how to mount an OCI Bucket as a FS into DB System in OCI. This can be very useful for our daily tasks.

Our DB System is running Oracle Linux Server 8.

[root@~]$ grep ORACLE_* /etc/os-release
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.8
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.8

For Oracle Linux 8 onwards, we use OCIFS.

So, before kicking off, we should make sure that we have the following points:

  • We have a Bucket in our tenancy.

  • We need to have enough space in disk in order to be used as the cache for the OCIFS utility.

  • By default, OCIFS uses API key-based authentication in order to autenticate. For this reason, we need to set up the OCI Cli on our machine. Below, you can see how to do it.

[OCI] OCI-cli y su configuración

Let's set up OCIFS as root user on our machine:

[root@~]$ dnf install ocifs -y
...
Last metadata expiration check: 2:19:05 ago on Sun 08 Mar 2026 12:38:39 PM UTC.
Dependencies resolved.
...
Installed:
  fuse-2.9.7-19.0.1.el8.x86_64                               
  fuse-common-3.3.0-19.0.1.el8.x86_64                               
  ocifs-1.2.0-6.el8.x86_64                              
...
...
Complete!

Great! Next, let's check the disk space in order to know where we can create a folder. This folder will be used as the OCIFS cache.

[root@~]$ 
df -h --output=source,size,used,avail,pcent,target | (read -r h; echo "$h"; sort -k2,2hr) | head -4
Filesystem                      Size  Used Avail Use% Mounted on
/dev/sdg                        196G   26G  161G  14% /u01
/dev/mapper/vg00-opt             33G  6.0G   26G  19% /opt
devtmpfs                         16G     0   16G   0% /dev

As we can see, /u01 has enough space.

[root@~]$ mkdir /u01/tmp

Let's check the name of the Bucket that we're going to mount as a FS on our machine.

After that, we use the ocifs command in order to mount it:

[root@~]$ mkdir /mybucket 
[root@~]$ ocifs --cache=/u01/tmp <name_bucket> /mybucket
[root@~]$ df -h /mybucket
Filesystem            Size  Used Avail Use% Mounted on
<name_bucket>          0     0     0    - /mybucket
[root@l23ai ~]# grep mybucket /proc/mounts
<name_bucket> /mybucket fuse.ocifs rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions 0 0

Now, we can see our Bucket as a FS. Moreover, we can see a new line in /proc/mounts file.

Lastly, let's create a file with some sample content:

[root@~]$ 
 touch /mybucket/passwd.bck && cat /etc/passwd > /mybucket/passwd.bck

Below, you can see that the file is correctly stored in our Bucket :

Looking forward to seeing you in the next article :)