Oracle Cloud – OCI – IaaS Attach and Mount Block Storage to a OEL Image

When you need an OCI IaaS image for a particular application, you typically need to create and then attach block storage for your application data. Here is an example of doing that for an Oracle Linux image. When done with the example, the Linux image as storage created mounted as file system /u01.

First Create the Block Storage. Here I have created db1 and db2. I will use db1 as my example. The OEM_volume was created for me by the OEM Marketplace image.
Attach the Volume to the instance.
View iSCSI commands. Copy them to run as root in the instance.
View and copy the iSCSI commands.
Run the iSCSI commands as root.
Partition the disk. Note the Volume you selected when you attached the storage. You can go back to the instance block volume attachments if you did not take note of it.
Make the file system. Note that the first partition on the disk in created by the fdisk is /dev/oracleoci/oraclevdb1

Get the UUID for the device. Note the device mapped to /dev/oracleoci/oraclevdb1 which is /dev/sdb1. Then, find /dev/sdb1 in /dev/disk/by-uuid copy the UUID.
Duplicate the sample line. Uncomment the copied line. Replace the UUID and the mount point. We are going to mount this as /u01.
Make the mount directory. Mount the storage. Show the mounted storage.

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.