Repository navigation
LAB 13 (Resizing Block Volumes)
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 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
sudo parted /dev/sdb print
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.
pvresize /dev/sdb1
pvdisplay /dev/sdb1
Now total physicla extent now 15359
vgdisplay vg_u01
df -h
but Logical volume showing same old 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