1. Home
  2. Cloud Servers
  3. Resizing Existing Discs

Resizing Existing Discs

If you need more space on an existing disc, you can increase its size without having to re-install your server.

Things to note

  1. At present, you cannot decrease the size of a disc. We have purposefully disabled this functionality as it can lead to filesystem corruption and data loss.
  2. If your Cloud Server is running Windows, follow the Windows Method instructions below.
  3. The procedure outlined below is quite safe, but you should always take backups beforehand, just in case!

Which method to use for partitioned & non-partitioned discs

If you’re planning on resizing a disc which hasn’t hasn’t got a partition table, you may encounter some issues when following the standard Linux method. As GParted is a partition tool, If the disc has no partitions, then the extra space will not be able to be allocated. The only way around this would be to create a new partition table, erasing all of the data on the disc, which is not convenient at all. The advanced Linux method, will work with both partitioned & non-partitioned discs (filesystem directly on the disc) as it will just extend the volume of the selected filesystem.

Standard method (for Linux)

Increase the size of your disc through the Bytemark Panel

  1. Login to the Bytemark Panel
  2. Click the ‘Servers’ tab
  3. Select the disc you want to resize, increase the size as required and click the ‘Resize disc’ button.
  4. When the resize operation is complete, click the ‘Shutdown’ button for your Cloud Server and then start it again. This is not the same as a restart, as the server must be fully off for the change to be applied.
  5. As soon as your server restarts, click the ‘Console’ button to open the console window.

Boot your server into ‘rescue’ mode and start GParted

  1. Watch the boot process carefully and press the Ctrl+n button (top-right of the console window) as soon as the ‘Press Ctrl+n for rescue prompt...‘ message appears (you’ve got to be quick!). If you are not quick enough, your server will load as normal. Press Ctrl+Alt+Del at the login prompt to restart your server and try again!
  2. At the rescue: prompt, type gparted and press Enter

Resize your partition using GParted

  1. When GParted has loaded (you may want to increase the size of the console window), click the GParted menu in the top left and select the correct device in the sub-menu. They are normally listed in the same order as on the control panel.
  2. You should see some unallocated space. Click on the partition click Resize/Move.
  3. Drag the slider to the right to fill all of the unallocated space. Click Resize/Move.
  4. Click on the Edit option at the top and then the Apply All Operations option.
  5. You will be prompted to confirm the changes. Click on Apply.
  6. Once the process has completed you can close gparted to reboot your cloud server. Click on the GParted menu at the top left and click Quit.

Advanced method (for Linux)

This method only applies to non-root discs. If you’re not familiar with the Linux command-line, you might prefer the Standard method above.

  1. Open the control panel, select your Cloud Server and increase the size of a disc.
  2. Use the control panel to shutdown your Cloud Server then start it again. This is different from a restart, as the server must be fully off for the change to occur.
  3. Login to the command-line on your Cloud Server.
  4. Unmount the disc in order to extend the filesystem. Run this command, but replace /dev/vdb with the name of the disc, which normally correlates with what is shown on the control panel. If you aren’t sure how to determine the name of the disc, try the Standard method above.
    sudo umount /dev/vdb
    
  5. Extend the filesystem to fill available space. Run the following commands, but replace /dev/vdb with the name of the disc:
    sudo e2fsck -f /dev/vdb
    sudo resize2fs /dev/vdb
    
  6. Mount the disc again at the appropriate location. Usually this command will do that for you (assuming there’s an entry for it in /etc/fstab):
    sudo mount -a
    

Windows method

  1. Increase the size of the disc through the Bytemark Panel.
  2. Restart your Cloud Server (using the ‘Restart’ button in the panel, not Windows).
  3. Log in to your server, for example, by clicking the ‘Console’ button in the panel.
  4. Open Windows Disk Management.
  5. Extend the partition to fill the available space.
Updated on March 20, 2019

Was this article helpful?

Related Articles