Extend root filesystem using LVM (Linux)

Extend root filesystem using LVM on Linux. This will cover both ext4 and xfs filesystem root partition extending. It will start by creating a new partition and then partitioning it and adding it to physical volume.

Step 1: Confirm Disk Partitions in Distribution.

You can do this by typing

df –h

Step 2: Format data disk as LVM partition

First become root by typing

sudo su –

Format disk partition by typing

fdisk /dev/xvda

Note: Device name differs for different distributions check by listing them with fdisk –l it is xvda in our case