Block Volumes

Block volumes are a type of storage, similar to an external hard drive for your computer. It allows you to store and manage data independently from your instances. You can attach a block volume to an instance, use it to store files, databases, or run applications, and then detach it and move it to another instance if needed. Block volumes are flexible, reliable, and designed to handle a range of tasks, offering scalable storage that grows as your needs do.


Attaching a block volume to an instance

Run these commands on your instance to start using a volume.

Replace <TARGET>with the volume target, e.g. vdb and <DIR_NAME> with the name of the directory you want to mount it to.

Format volume (only needed once, e.g, if it's a new volume):

mkfs.ext4 /dev/<TARGET>

Create directory:

mkdir /mnt/<DIR_NAME>

Mount volume:

mount /dev/<TARGET> /mnt/<DIR_NAME>

Recommended: add volume to fstab (this will automatically mount the volume on every system startup):

echo "/dev/<TARGET> /mnt/<DIR_NAME> ext4 defaults 0 0" >> /etc/fstab


Resizing a block volume

After resizing the block volume from the dashboard, you need to shutdown and start the instance from the dashboard (in case it was not already shut down).

Resizing the OS volume

The OS volume is resized automatically after the next system start. Please make sure you perform shutdown from the cloud dashboard 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 the non-OS volume.

Replace <TARGET> with the volume target e.g. vdb.

Instructions for EXT4 filesystem (default)

If partitioned (e.g. with OS volumes), that are also ext4 by default. The default partition number is 1):

growpart /dev/<TARGET> <PARTITION_NUMBER>
resize2fs /dev/<TARGET><PARTITION_NUMBER>

There's one space character between the parameters of the growpart command

If not partitioned:

resize2fs /dev/<TARGET>

Instructions for XFS filesystem

Same process as in Instructions for EXT4 filesystem (default), but replace resize2fs with xfs_growfs:

xfs_growfs /dev/<TARGET>

Useful commands

To check if the volume is partitioned use:

lsblk

To check the filesystem type use:

df -hT


Cloning a block volume

Cloning a volume will duplicate all of its data onto a new volume. A volume can be cloned from Volumes page.

Volumes must either be detached or the instance to which it is attached must be shutdown.

Currently, volumes can only be cloned in the same datacenter location. For example, if the original volume is in FIN-01 datacenter, the cloned volume will also be in FIN-01.

The volume can be cloned from NVMe to HDD and vice versa. Therefore, cloning can be used for a more cost effective storage (HDD) if the data is not needed for some time.

Last updated