Skip to content

LAB 13 (Resizing Block Volumes)

arunsinghchauhan38-arch edited this page Apr 30, 2026 · 2 revisions

Resizing Block Volumes

Increase Block Volume size in OCI console

1. Go to the Block Volumes, click on the 3 dots and select the edit option.

image image image

2. Update the Size as 60 GB and then click on Update.

image image

3. After Click on update copy the given command.

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
image

Increase disk Size Using Putty

Now open the putty application and login into server. After this run command

Before running the copied command we will check the size of block volume

lsblk

we also check the current size of the specific disk we want to increase

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

Now, we edit copied command as per the current requirement.

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

After this, next we run lsblk command to check disk size has increased or not

image

Check the disk size by command

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

Check the partition exists or not

sudo parted /dev/sdb print
image

To increase the partition to new size

sudo growpart /dev/sdb 1
image

Now again run partition command and check the size of part

image

Now Size of the partition increased , as we can see, the size has increased by lsblk command

image

Now run the command to display detailed information about logical volume.

lvdisplay -am /dev/mapper/vg_u01-lv_u01
image

The Logical Volume is still same as before, it has not changed or increased not.

Next , We resize the physical Volume

pvresize /dev/sdb1
pvdisplay /dev/sdb1
image

Now total physicla extent now 15359

Next, we check volume Group

vgdisplay vg_u01
image

Now we check logical volume size

df -h
image

but Logical volume showing same old size.

image

Now we increase the logical volume size

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

Now we show the our logical volume successfully resized - 15359

image
df -h

when we run this command that time we found that our previous size

image

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

resize2fs /dev/mapper/vg_u01-lv_u01
image

after run this command its show that our filesystem now updated or changed with 15727616

df -h

when we run this command we found our filesystem now updated with new volume

image

Clone this wiki locally