Advanced Setup Guides

Manually Resize Disk After Plan Upgrade on live Linux Systems

10min



Important Notice: Risks Associated with Resizing Disk Space

Resizing disks and partitions on production Linux operating systems is a complex and potentially hazardous process that should only be undertaken by experienced system administrators. There are significant risks involved, including the possibility of data loss. It is imperative to perform a complete backup of all data on the drive before attempting any resizing operations. Additionally, be aware that the process might not work as intended, and unforeseen issues could arise. Please proceed with caution and use this guide at your own risk.





It is not always possible to reinstall the operating system to automatically add disk space. With this guide, you can manually resize your disk and expand the existing root partition.

To resize disk space and unallocated space on your disk, use SystemRescueCD. The SystemRescueCD is a Linux system rescue disk available as a bootable CD-ROM.

Remember, modifying disk partitions and file systems can be risky and may result in data loss, especially if there's a power interruption or if the operations are performed incorrectly. Always back up important data before proceeding. Here’s a general guide on how to resize disk space manually:

Access the VPS Management Portal

After the Upgrade was confirmed ...

  • Login to your VPS Management Portal
  • Locate your VPS from the Services tab
  • After confirming the upgrade, Initiate shutdown (power-off) and turn on the VPS again. It is important to fully power off.

Mount System Rescue CD and Boot

  • Click Mount ISO
  • Select System-Rescue-CD-6-x86.iso image
  • Set button force reset & boot
  • Finish mount by clicking "Mount ISO"
    • 
Document image


Launch noVNC

  1. Click "Launch noVNC" to see console output
  2. Click into the noVNC browser window to set focus
  3. Select "Boot SystemRescueCd using default options"
  4. Press Enter to confirm
Document image


Resize partitions

  • Start the Graphical Interface: If SystemRescueCD boots into a command line, you can start the graphical interface by typing: startx.
  • Open GParted: Once in the graphical interface, open GParted. GParted is a free partition editor for graphically managing your disk partitions. Press "Fix" button on "Libparted Warning" pop-up window.
Document image


In the GParted window that opens, you will see several partitions. It will vda1 and vda2 partitions. You need to add unallocated space to vda1 (root) partition but you will not be able to expand space in the /dev/vda1 (root) partition without deleting /dev/vda2 (swap).

  1. Remove the swap partition. The vda 2 (swap) partition will be located next to vda1 and the unallocated space. Right-click on this partition and set Delete.
  2. Resize Partitions: To extend the root partition(vda1), right-click on it in GParted to root partition(vda1), and select “Resize/Move”. Then, drag the handles to include the unallocated space and click “Resize/Move”. In the field "Free space following" install the size of your future swap partition.
  3. Apply Changes: After arranging the partitions as desired, click the “Apply” button in GParted to apply the changes. Be aware that this process can take some time and may result in data loss if not done correctly.
  4. Сreate a swap partition. Right-click on unallocated space and select New. In the Field File system switch to Linux-swap and click Add button.
Document image

  1. Check and Repair File Systems: Once the partitioning is complete, it's a good idea to check the file systems for errors. You can do this from GParted by right-clicking on each partition and selecting “Check”.
  2. Exit and Reboot: After completing the partitioning and checks, exit GParted and the graphical interface, then reboot your system.

Identify the New Swap Partition

  1. Log into Your VPS: Login to with root of the system.
  2. List Current Partitions: Use the command blkid to list all partitions and identify the swap partition and its UUID. Copy the UUID of a swap partition. blkid
  3. Edit FSTAB config: Before editing /etc/fstab, it’s a good idea to back it up. Use: cp /etc/fstab /etc/fstab.backup
  4. Edit fstab: Open the /etc/fstab file in a text editor: nano /etc/fstab
  5. Locate Swap Entry: Find the line in fstab that corresponds to the swap partition. It will have 'swap' in the type field.
  6. Update UUID: Replace the old UUID with the new one you noted earlier. Be careful to only change the UUID in the swap line.
  7. Save and Close: Save the changes using CTRL+O combination and close the editor.
  8. Restart the VPS: Finally, reboot the server to boot into your primary operating system. You can continue to monitor this process via the VNC connection until you have confirmed that the server boots correctly and the new disk settings are functioning as expected.
  9. Verify Swap Status: Ensure that the swap is active and using the new UUID by running "swapon -s" or "cat /proc/swaps"

Final Steps:

Congrats!

Congratulations on completing the manual disk resizing process using the SystemRescueCD! Navigating the complexities of SystemRescueCD and ensuring the safety of your data throughout this delicate procedure is no small feat. Well done on achieving this significant milestone in system management! 🌟 Well done on enhancing your system's capabilities! 🎉👍