Skip navigation

Monthly Archives: March 2020

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.

  1. resize the partition (growpart is an utility alias of parted)
  2. resize the lvm2 partition
  3. extend the lvm2 volume to the remaining available space
  4. mount the partition
  5. 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