At this stage, we have one PV (physical volume), one VG (volume group), and one LV (logical volume).
As you can see from the screenshot, we don't have space available in the physical volume and volume group to expand our logical volume. To expand the logical volume, we need to create a new physical volume. Then expand our logical volume by adding a new physical volume to it.
To create a new partition on the hard disk, we will use the fdisk program:
# fdisk /dev/vda
n – to create a new partition on the disk;
p – to assign primary to the new partition.
Specify the number that this section will wear. The First sector and the Last sector are specified by default. After that, we will receive a notification that a 5 GB Linux partition has been created.
Now you need to change the partition type from Linux to Linux LVM:
t – to change the type of the created partition.
We indicate the number of our section:
8e is the hex code for the LVM type.
As a result of this operation, we will receive a message that the partition has been changed from Linux to Linux LVM.
Now let's make sure everything is fine by pressing p:
p – to list all volumes on our disk
Then w, to write the changes to disk and exit the fdisk program.
After exiting the program, we get a message to apply the changes, we need to reboot (preferably) or run the partprobe command.
After we have successfully created a partition, we need to create a new physical volume based on this partition:
# pvcreate /dev/vda2
The command will return that the physical volume was successfully created: