Back to home

Resize a partition after a diskupgrade

Important: This tutorial only applies to VServers that are configured with LVM. It is assumed that the partition scheme is left unaltered after the initial delivery of your VServer. Therefore, depending on the configuration, some values may differ.

The changes do not have to be done in a rescue system since LVM allows it to do it live.

The disc can be named /dev/sda or /dev/vda depending on the server generation. The following command covers both variants automatically.

  1. Resize the partitions /dev/vda2 and /dev/vda5.

    root@server:~ # growpart /dev/[sv]da 2
    root@server:~ # growpart /dev/[sv]da 5
  2. Resize the PV:

    root@server:~ # pvresize /dev/[sv]da5
  3. Extend the LV. lvs shows you all available volumes. In the following example the root partiton and the filesystem will be increased:

    root@server:~ # lvextend -l +100%FREE /dev/vg0/root --resizefs

Didn't find what you were looking for?

Contact our support:

+41 44 637 40 40 Support Portal