Say, for example, you’ve got a lovely CentOS VM (using XFS by default) which has a disk that isn’t quite big enough. Fair enough, your VM Hypervisor is sensible enough to resize that disk without question… How do you resize the XFS partition? Assuming you’ve got your disk mounted as /dev/sda
, and you’ve got a boot
volume as partition 1 and a root
volume as partition 2 (the standard install model)
parted /dev/sda resizepart 2 100%
partprobe /dev/sda
pvresize /dev/sda2
lvextend /dev/centos/root /dev/sda2
xfs_growfs /dev/mapper/centos-root
Research via: