Resize EC2 file system with lvm

On an EC2 server with an LVM file system, I need to increase the size of the / partition. First, increase the size of the volume in the Amazon AWS console as per Resize Amazon EC2 Boot Disk, once volume size is increased, you need to resize your filesystem.

Here is result of parted -l

/dev/nvme0n1 was resized to 172 GB, but the 4th partition was only using 26 GB.

Resize the 4th partition with the command “growpart /dev/nvme0n1 4”

Resize physical volume with “pvresize /dev/nvme0n1p4” command.

Finally resize logical volume with the command “lvextend -r -l +100%FREE /dev/mapper/cl-root”. -r option resize the file system also.

Now the size of the / portion is increased to use full available disk space.

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *