Blog

How to "stretch" the file system of a VDS after changing the tariff plan without data loss?

Learn how to safely extend the file system of a VDS after changing the tariff plan, ensuring no data loss.

Dmytro
VDS File System Expansion Partition Management Linux Data Safety Resize File System

How to “Stretch” the File System of a VDS After Changing the Tariff Plan Without Data Loss?

You have changed your SSD VDS tariff plan, but the size of the file system has remained the same? Let’s solve this issue by modifying the partition table and increasing the available disk space — while preserving all data and settings.

Understanding the Issue

Our SSD VDS utilizes KVM full virtualization technology. This means that the VDS represents a full-fledged server with its own BIOS, video adapter, keyboard, and, of course, a “hard disk”. When the disk size increases, the parameters change, and additional storage becomes available. However, the partition parameters remain the same unless modified.

Caution

Attention: Despite the simplicity of the operation, one should proceed carefully. Incorrect values can lead to operating system errors or data corruption. Always back up your data before making changes, and save key parameters of the partition table separately.

Steps for Debian/Ubuntu Systems

  1. Start fdisk and print the current partition table:

    root@debian8:~# fdisk /dev/vda
    
  2. Delete partitions 5 and 2 sequentially:

    Command (m for help): d
    Partition number (1,2,5, default 5): 5
    Partition 5 has been deleted.
    Command (m for help): d
    Partition number (1,2, default 2): 2
    Partition 2 has been deleted.
    
  3. Create a new extended partition and a new Linux partition:

    Command (m for help): n
    Partition type
    e extended
    Select (default p): e
    
  4. Print the new partition table and write the changes:

    Command (m for help): print
    Command (m for help): write
    
  5. Reboot the operating system:

    root@debian8:~# reboot
    
  6. Resize the ext4 file system:

    root@debian8:~# resize2fs /dev/vda5
    

Steps for CentOS 7 Systems

  1. Start fdisk and print the current partition table:

    [root@centos7 ~]# fdisk /dev/vda
    
  2. Delete partition 2 and recreate it:

    Command (m for help): d
    Partition number (1,2, default 2): 2
    Command (m for help): n
    
  3. Write the changes and reboot:

    Command (m for help): w
    root@centos7:~# reboot
    
  4. Resize the xfs file system:

    [root@centos7 ~]# xfs_growfs /
    

Final Notes

In some cases, you may be prompted to remove an existing file system label; if so, do not remove it. Always answer ‘no’ to such prompts.

If you have questions about resizing partitions after changing the tariff plan, please contact support for assistance.

Happy working!

Need Help?

Our support team is available 24/7 to assist you with any questions or issues.

Contact Support