After upgrading the storage space of your virtual server (VDS) package you rented through İyibirNet, the operating system inside the server needs to recognize and expand (extend) this new space. Since LVM (Logical Volume Manager) structure is used in AlmaLinux 8 and 9 versions, this process can be done safely with a few SSH commands.
Step 1: Scanning and Verifying the New Disk
First, connect to your server as root via SSH. List the available disk spaces to verify whether the newly allocated disk space is seen by the operating system:
lsblk
You will see the expanded capacity under your current disk in the output, but the LVM partition remains at its old size.
Step 2: Expanding the Partition
We use the growpart tool to spread the main partition of your disk to the new space. If it is not installed: dnf install cloud-utils-growpart -y
growpart /dev/sda 2
Step 3: Expanding LVM (Physical Volume)
Our disk's partition space has grown, now we must introduce this new space to LVM:
pvresize /dev/sda2
Physical space expanded successfully. Now let's fill the entire root directory (Logical Volume) with the remaining free space:
lvextend -l +100%FREE /dev/mapper/almalinux-root
Step 4: Synchronizing the Filesystem
We expanded LVM, we have one last step left. We must notify our XFS or EXT4 filesystem of this new space. Since AlmaLinux uses XFS by default:
xfs_growfs /
If you check your disk usage with the df -h command, you will see that your new disk space has been successfully added. Congratulations!