Expanding Disk Space on VPS (SSD)

If you have requested additional SSD space, there may be a need for you to manually expand the disk space on the VPS.

You will need to login to your VPS via Putty or another SSH client and do the following:

Type: df -h

This will report a size for /dev/mapper/VolGroup00-LogVol00. This is typically less than the size allocated but this is normal.

If you have added 10GB to your VPS and it only shows the original size then you will need to manually resize your partition.

If you are not sure if your disks are set to GPT or MBR. You can do that by completing the following command:

Type: fdisk -l /dev/sda

If it says: WARNING GPT then you will be expanding a GPT partition. If not, then your partition is MBR.

If your partition is GPT it should have been expanded automatically upon ordering your disk upgrade. If it wasn't it's most likely your root password in our system doesn't match your current root password.

Expanding MBR

Type: fdisk -l

You will see a device list e.g.:

Device Boot Start End Blocks Id System
/dev/sda1 * 1 14 103424 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 14 1306 10380288 8e Linux LVM

Take note of the last existing LVM partition (in this case /dev/sda2)

We need to create a new partition, for the purpose of this article our example shows the new partition will be partition number 3 (e.g. /dev/sda3)

Type:

fdisk /dev/sda
n
p
new partition number (e.g. 3)
{enter}
{enter}

This will create the new partition. Now we have to set it to the correct mode, still in fdisk type:

t
new partition number (e.g. 3)
8e
w

We have now created the new partition and written it to the partition table.

You can do that by:

1. Rebooting the server

2. Running the command:

# partx -v -a /dev/sdX

Where sdX is the actual drive (sda, sdb, sdc, etc). The flag -v means "verbose output", -a means "Add all partitions". The output will contain errors about already existing partitions, but new ones will be added.

Once partitions re-synced, SSH back into the VPS (if required) and type:

vgextend VolGroup00 /dev/sda3 (where 3 is the new partition number)
lvextend -l +100%FREE /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00

This will perform an online resize of the logical volume adding the new partition to it expanding the disk space available.

Once complete type: df -h

The results should confirm the increase in available space.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Create and setup your own name (DNS) servers in WHM

Setting up your own private nameservers on a cPanel server has many benefits, most importantly...

Maintaining a CPanel/WHM VPS

If you have got a CPanel/WHM based VPS and are not sure on how you should monitor and maintain it...

Connect to your VPS via SSH

Learn how to connect to your Linux VPS via SSH. This guide will give you the process to connect...

Installing NGinx on a CPanel Server Manually

To install NGinx on cPanel servers we recommend you use the product NGinxCP available at...

How to install Plesk On Linux

When it comes to top-tier web hosting control for business needs, Plesk surely deserves a spot on...