How to Extend a VPS Disk After Upgrading the Plan

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 and 2 with the partition number. You can check them using the lsblk 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.

Leave a Reply 0

Your email address will not be published. Required fields are marked *