Resizing a block volume

circle-exclamation

Resizing the OS volume

The OS volume is resized automatically after the next system start. Please make sure you perform shutdown from the cloud console in order for the change in volume size to be detected during start-up.

Resizing other block volumes

Run these commands on your instance to resize a non-OS volume.

Replace:

  • <DISK> with the disk name (example: vdb or nvme1n1)

  • <PARTITION_NUMBER> with the partition number (usually 1) when using partitions

  • <PARTITION> with the full partition name (example: vdb1 or nvme1n1p1)

  • <MOUNT_DIR> with the current mount directory for the filesystem (example: data)

If you don't have growpart, install it first:

sudo apt-get update
sudo apt-get install -y cloud-guest-utils

Instructions for EXT4 filesystem (default)

If partitioned (common for OS disks):

sudo growpart /dev/<DISK> <PARTITION_NUMBER>
sudo resize2fs /dev/<PARTITION>
circle-exclamation

If not partitioned:

Instructions for XFS filesystem

Grow the partition (if any), then grow the filesystem.

xfs_growfs must be run on the mount point, not the block device.

Useful commands

To check if the volume is partitioned use:

To check the filesystem type use:

Last updated

Was this helpful?