5.3.11. Increase partition sizes on VPS

Attention!

Before performing any actions, be sure to create a backup of the server and save copies of all important data from the server to your PC.
Resizing partitions may be necessary when upgrading your VPS plan, as additional disk space appears on the system as unallocated space.

You can change the size of partitions using specialized graphical interface programs or via the console.

  1. Create a backup of the server and save copies of all important data from the server to your PC.
  2. Connect the latest available version of the System Rescue CD image — the server will automatically reboot.
  3. Connect to the server via VNC.
  4. If the main menu appears, select "Boot SystemRescueCd using default options":
  5. Start the graphical interface — enter the command startx and press Enter:
  6. Launch the GParted app:
  7. Right-click on the section you want to enlarge and select "Resize/Move" from the context menu:
  8. Use the arrows to stretch the partition to fill all available space so that the "Free space preceding" and "Free space following" fields show zeros, then click "Resize/Move":
  9. Click on the apply changes button and confirm the operation:
  10. Wait for the operation to complete successfully:
  11. Disconnect the mounted image.
  12. After restarting the server, connect to it via SSH and check the size information:
    df -h

Attention!

The resize2fs program only supports ext2-ext4 file systems. If your server uses a different file system, use Gparted or another method.
  1. Create a backup of the server and save copies of all important data from the server to your PC.
  2. Connect the latest available version of the System Rescue CD image — the server will automatically reboot.
  3. Connect to the server via VNC.
  4. If the main menu appears, select "Boot SystemRescueCd using default options":
  5. Wait for the command prompt to appear:
  6. Check the current disk partitioning:
    fdisk -l
  7. Launch fdisk in interactive mode:
    fdisk /dev/xvda
  8. In interactive mode, execute the following commands in fdisk:
    1. Display a list of current partitions:
      p
    2. Delete the section you want to enlarge (only the markup is deleted, the data itself is not affected):
      d
      3

      Instead of 3, specify the number of the partition to be deleted. The numbers can be found in the list of current partitions.

    3. Create a new partition instead of the deleted one:
      n
      p
      3

      p — primary partition.
      Instead of 3, enter the number of the partition you are creating (it will be the same as the deleted one).
      When prompted for the start and end sectors, just press Enter.
      ⚠️ When prompted to delete the signature, answe n.

    4. Check the resulting partitioning:
      p
    5. Save the changes:
      w
  9. Check the file system of the created partition:
    e2fsck -f /dev/xvda3

    Instead of 3, enter the number of the partition you created..

  10. Change the file system size of the created partition:
    resize2fs /dev/xvda3

    Instead of 3, enter the number of the partition you created.

  11. Exit the console:
    exit
  12. Disconnect the mounted image.
  13. After restarting the server, connect to it via SSH and check the size information:
    df -h
Content

    (3)