Ran into a situation with an AWS AMI that was created with an insufficiently sized root partition. The volume ended up correctly sized but mostly unused. There are numerous procedures for this, but with varying tool sets and file system types.
- resize the partition (growpart is an utility alias of parted)
- resize the lvm2 partition
- extend the lvm2 volume to the remaining available space
- mount the partition
- update the file system to utilize the extended space
growpart /dev/xvdf 2
pvresize /dev/xvdf2
lvextend /dev/partnameVG/part2 -l+100%FREE
mount /dev/partnameVG/part2 /mount_point/
xfs_growfs /mount_point/
Note that for swap partitions, instead of resizing the file system you will be recreating the swap with mkswap.
mkswap /dev/partnameVG/part2