OCI: How to extend a block storage

To create and mount a logical volume on a new block storage volume, process as below, the example given here is for /dev/xvdc

pvcreate /dev/xvdc1
vgcreate vg_oracle /dev/xvdc1
lvcreate -l 20 -n lv_oracle vg_oracle
lvextend --extents +100%FREE /dev/vg_oracle/lv_oracle
e2fsck -f /dev/vg_oracle/lv_oracle
mkfs.ext4 /dev/vg_oracle/lv_oracle -L oracle
mkdir -p /u01/app/oracle
mount /dev/mapper/vg_oracle-lv_oracle /u01
chown oracle:oinstall /u01/app/oracle

To extend the root logical volume:

pvcreate /dev/xvdc1
vgextend vg_main /dev/xvdc1 
lvextend --extents +100%FREE /dev/vg_main/lv_root
resize2fs /dev/vg_main/lv_root