LAB 13 (Resizing Block Volumes) - arunsinghchauhan38-arch/CLOUDARCHITECTDOC GitHub Wiki
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.
2. Update the Size as 60 GB and then click on Update.
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
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
Now, we edit copied command as per the current requirement.
sudo dd iflag=direct if=/dev/sdb of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/sdb/device/rescan
After this, next we run lsblk command to check disk size has increased or not
Check the disk size by command
lsblk -ap /dev/sdb | head -2
Check the partition exists or not
sudo parted /dev/sdb print
To increase the partition to new size
sudo growpart /dev/sdb 1
Now again run partition command and check the size of part
Now Size of the partition increased , as we can see, the size has increased by lsblk command
Now run the command to display detailed information about logical volume.
lvdisplay -am /dev/mapper/vg_u01-lv_u01
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
Now total physicla extent now 15359
Next, we check volume Group
vgdisplay vg_u01
Now we check logical volume size
df -h
but Logical volume showing same old size.
Now we increase the logical volume size
lvextend -l +100%FREE /dev/mapper/vg_u01-lv_u01
Now we show the our logical volume successfully resized - 15359
df -h
when we run this command that time we found that our previous size
The last Step to resize the file system to extended 10 gb with right file format
resize2fs /dev/mapper/vg_u01-lv_u01
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