How to edit partitions on Linux after upgrading the VPS plan?
If you installed the system yourself and are using LVM, the general procedure is as follows:
- We do not modify existing partitions, but instead create a new partition via fdisk (eg sda2).
- After adding the partition, restart the VPS.
-
Now you add the new partition (here sda2) to LVM, the commands are approximately the following and may vary individually:
-
Initialization of sda2 partition for use with LVM, sda2 - new partition created by fdisk
pvcreate /dev/sda2
-
You can find out the name of the group you want to extend by using the lvs - VG column command
vgextend GROUP /dev/sda2
-
The unit name can be found in the same way as the group - column LV
/dev/mapper/GROUP-UNIT
-
Extension about 15 GB
lvextend --size +15G /dev/mapper/GROUP-UNIT
-
Inflating an existing filesystem over LVM
For CentOS with XFS, however, resize2fs cannot be used, so it is necessary to select xfs_growfs with the mountpoint path eg.resize2fs /dev/GROUP/UNIT
xfs_growfs /home
-
Initialization of sda2 partition for use with LVM, sda2 - new partition created by fdisk
For VPS servers with WebApps
, the disk partition is automatically modified after the VPS plan upgrade.