How To

Increase disk size in a Linux server

  1. Before we can change anything we first need to turn off the server that the drive is connected to, so we click the power button in the server box. The drive is the smaller box to the right. Within this you can see a button with two blue cogs on it. This shows you the configuration screen for that disk drive.
  2. Here we can change the size of the disk, and underneath, mount an image. Drag the slider to increase your disk size.
  3. Now the disk allocation is larger, but we still need to grow the partition. Turn the server back on and access it using SSH. Use the IP address displayed on the control panel and now you can see the command line for your Linux server.
  4. First we need to check the current partitions by typing: df -h
  5. Here we can see the filesystem still occupies only 15GB. Our pre-installed Linux images do not have partitions, only a single filesystem filling the entire drive, so it’s sufficient to run resize2fs directly on this device. The command is:
  6. resize2fs /dev/vda

    This will automatically grow the filesystem to fill all the extra available space. Alternatively, you can specify the exact amount to scale it to by adding the size:

    resize2fs /dev/vda 18000M

  7. We can then check the change by running:
  8. df -h

    We can see that the filesystem has now grown to 18GB.