Resizing Volumes
One of the benefits of Brightbox, is the flexibility you have when you need to increase the resources allocated to your Cloud Servers.
Whenever you need more storage allocated to a Cloud Server you can either:
- Attach additional Volumes
- Resize the Cloud Server (for Server Types with local SSD storage), or
- Resize an existing Volume – which is the subject of this guide
Resize the volume
The current size of a volume can be viewed in the volume details view.
Click the Resize
button and you’ll be directed to the Resize Volume panel.
Choose the new volume size you require and click Save
.
You’ll be presented with a confirmation dialogue and if you’re happy to proceed,
click the Resize Volume
button.
Extend the filesystem
The resize happens almost instantly but its filesystem must be extended before you can make use of the additional space.
Grow the partition (if required)
For unpartioned volumes such as auto-formatted additional volumes, you can skip straight to Resize the filesystem below.
For partitioned volumes, such as boot volumes created with an OS image, you’ll first need to grow the root partition.
To see the current list of partitions:
$ lsblk /dev/vda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 100G 0 disk
├─vda1 252:1 0 39.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
In this example, we have resized the Volume from 40GB to 100GB. The vda
device
is now showing as 100GB but the vda1
partition mounted at / is still ~40GB and
needs to be “grown” to use the available space:
$ sudo growpart /dev/vda 1
CHANGED: partition=1 start=227328 old: size=83658719 end=83886047 new: size=209487839 end=209715167
We can now confirm that the size of the vda1
partition matches the increased
volume size:
$ lsblk /dev/vda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 100G 0 disk
├─vda1 252:1 0 99.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
The filesystem itself can now be resized to fit the partition.
Resize the filesystem
You need to use the appropriate resize tool for your filesystem. Most of our
official images use ext4
or xfs
.
For ext4
use resize2fs
:
$ sudo resize2fs /dev/vda1
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/vda1 is mounted on /; on-line resizing required
old_desc_blocks = 5, new_desc_blocks = 13
The filesystem on /dev/vda1 is now 26214400 (4k) blocks long.
For xfs
use xfs_growfs
:
$ sudo xfs_growfs /dev/vda1
meta-data=/dev/vda1 isize=512 agcount=16, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=0 inobtcount=0
data = bsize=4096 blocks=10485760, imaxpct=25
= sunit=16 swidth=16 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=5120, version=2
= sectsz=512 sunit=16 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 10485760 to 26214400