Have you ever used LVM? It is one of the most recommended tools for a system admin who works on a web server.
Use the command for checking the filesystem size:
The below command is to check the presence of drives and it helps to increase the size of the filesystem:
Perform disk size increase:
Go to the path /dev/sda4 (Linux LVM) for increasing the size up to 10GB.
Creation of partition:
Once if you increase the disk size and then perform the partition by using the command:
Tap on the N for doing partition.
To select a type like primary or secondary click on the P command.
Set the default partition number as 3.
Set the sectors of start and end and check the hyphen is used to match their values. Still, you have space as unallocated:
Image
You can even change the type as the default one by Linux LVM. Use the command “T” for identifying the partition and then type hexadecimal number 8e.
Long press on the command “P”
By now, you have created the partition /dev/sda3. To save all your changes use the command “W”.
Extension of LVM:
Use the pvcreate command for creating the LVM volume:
According to the partition you created you can add the volume. You can be trying using vgdisplay and so the default one is cl:
Image
To create the group, you can add partition:
To expand the path as well as the name you can use the command lvdisplay
To advise the logical volume, do path specification by using the command lvextend. For specifying the free space, parameters are recommended -l +100%FREE.
Last is not least! Do expansion on the filesystem by using xfs command:
To use ext4, the below command will help you:
Now, you will see the result! Do check on the result whether it matches the created one or not.
That’s it! Follow all the commands as per the given structure! You will get the result as per your expectation.
Use the command for checking the filesystem size:
Code:
df –h
Code:
fdisk –l
Go to the path /dev/sda4 (Linux LVM) for increasing the size up to 10GB.
Creation of partition:
Once if you increase the disk size and then perform the partition by using the command:
Code:
fdisk /dev/sda
To select a type like primary or secondary click on the P command.
Set the default partition number as 3.
Set the sectors of start and end and check the hyphen is used to match their values. Still, you have space as unallocated:
Image
You can even change the type as the default one by Linux LVM. Use the command “T” for identifying the partition and then type hexadecimal number 8e.
Long press on the command “P”
By now, you have created the partition /dev/sda3. To save all your changes use the command “W”.
Extension of LVM:
Use the pvcreate command for creating the LVM volume:
Code:
pvcreate /dev/sda3
Image
To create the group, you can add partition:
Code:
vgextend cl /dev/sda3
Code:
Code:
Lvdisplay
Code:
lvextend -l +100%FREE /dev/cl/root
Code:
xfs_growfs /dev/mapper/cl-root
Code:
resize2fs -p /dev/mapper/cl-root
Code:
df –h