LAB 16 ::‐ Resizing Block Volumes ? - guptasanjeev-52/oci_docs GitHub Wiki

Steps to Resize Block Volumes...

Firstly , Open the OCI Console and Click on Burger Menu...

Burger Menu >>> Block Volumes 

In The Block Volumes click on the three Dots in the last and Select the EDIT option...

Click on the upside arrow on the Block volume size upgrade it how much you want to increase the SIZE...we are Increasing by 10GB and Update IT.

Increase in Disk Size

Next, we will receive a rescan commands that needs to be run in PuTTY to increase the size of the block volume.

sudo -i
lsblk

RUN the COMMAND in the putty Configuration (current size of the specific disk)...

lsblk -ap /dev/sdb | head -2
sudo dd iflag=direct if=/dev/oracleoci/oraclevd<paste device suffix here> of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevd<paste device suffix here> | cut -d'/' -f 2`/device/rescan

Now, EDIT the copied rescan command according to the current requirement (i.e., which disk we want to upgrade)

sudo dd iflag=direct if=/dev/sdb of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/sdb/device/rescan

Then run lsblk command to check disk size is increased or not

lsblk
lsblk -ap /dev/sdb | head -2

Here we can see disk size is increased...

But logical volume is still not increased...

df -h

Verify whether the partition exists...

sudo parted /dev/sdb print

In the screen below, we can see that the size of the partition remains the same as before.

Increase the partition to new size...

Now grow the partition

sudo growpart /dev/sdb 1

Below we can see old and new size of partition

Again run the partition command and check the size of part

sudo parted /dev/sdb print

Now size of the partition is increased

Run lsblk command and check size of disk and partition.

lsblk

As we can see, the size has increased

Now, run the command to display detailed information about a specific logical volume (lv_u01) in a volume group (vg_u01)

lvdisplay -am /dev/mapper/vg_u01-lv_u01

The logical volume is still the same as before; it has not increased yet

Next, we will Resize the Physical Volume

pvresize /dev/sdb1
pvdisplay /dev/sdb1

Physical volume still display the old volume in allocated PE

we can check volume group allocated PE also

vgdisplay vg_u01

IN below screen, we can see total PE,allocated PE and free PE

As we can see below, Logical volume is still not increased

df -h
lsblk

Now, we Extend the Logical volume

lvextend -l +100%FREE /dev/mapper/vg_u01-lv_u01

Logical volume is increased now

lsblk
df -h

But df –h still shows the old value

The last step is to resize the file system to extended 10 gb with right file format

resize2fs /dev/mapper/vg_u01-lv_u01

Finally, as shown in the screen below, running (df -h) confirms that the logical volume has been extended to the required size...

THANKYOU!