Extend Linux system partition
Create partition
Please first run the following command:
cfdisk
First, a new partition must be created. To do this, navigate to the empty memory and select “New” below.
The suggested size can be adopted. Next the type needs to be changed. To do this, select Type and select LVM (8e) as type.
Then complete the changes with Write and exit cfdisk with Quit.
Add partition to LVM
First perform a “rescan” with partprobe so that the previously created partition is found.
In this example sda3. This can of course vary.
In the next step we add the partition to the LVM with the following command:
vgextend ubuntu-vg /dev/sda3
Using the pvs command you should now see the following:
Expand existing LVM volume
The existing volume is expanded to include the new free storage space:
lvextend –l+100%FREE /dev/ubuntu-vg/root
Finally, the file system must be expanded in order to be able to use the new storage space:
df –h
resize2fs /dev/mapper/ubuntu—vg-root