How to Extend a VPS Disk After Upgrading the Plan
VPS disk expansion after plan upgrade
When you switch to a higher VPS plan, the disk space may not expand automatically. To make use of the newly allocated storage, you need to perform a few steps in the server console.
Step 1. Expand the partition
Use the parted tool to resize the partition and allocate all available space.
Example:
sudo parted /dev/xvda resizepart 2 100%
Replace
/dev/xvda
with your disk name and2
with the partition number. You can check them using thelsblk
command.
Step 2. Resize the filesystem
After expanding the partition, you need to update the filesystem (ext4) to use the additional space.
sudo resize2fs /dev/xvda2
Make sure to specify the partition (e.g.,
/dev/xvda2
) rather than the entire disk.
Step 3. Verify the result
Check that the disk has been successfully resized with:
df -h
This command will show the updated size and usage of your VPS disk.