Extending block storage on IaaS OPC

To create and mount a logical volume on a new block storage volume, process as below, typically 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
Advertisements

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: