Wednesday, January 8, 2020

Extending CentOS 7 File System after Resizing the Volume ( Root without Reboot) - LVM

increase disk size of the VM (VMware AWS and Azure provide visual interface to do this task)

scan the disk to see the new disk size, run the following command for the kernel to learn the new disk size

echo 1 > /sys/block/sda/device/rescan

then install the cloud-utils-growpart script:

yum install cloud-utils-growpart
Next, use it to grow the logical partition to extend to all the available space:
growpart /dev/sda 2
pvresize /dev/sda2
Extend and Resize filesystem
lvextend -l+100%FREE -r /dev/centos/root

No comments:

Post a Comment