Wolkra

Volumes

Updated

A volume is block storage that you attach to a server like an extra disk. Volumes range from 10 GB to 10 TB, can be grown online, move between servers and are billed per GB per month.

Use volumes for data that should be separate from the server: databases, uploads, media, backups or anything that grows.

Create a volume

  1. Open Volumes in the console and choose Create volume.
  2. Pick a size between 10 GB and 10 TB.
  3. Choose a server to attach it to, or leave it detached.
  4. Choose whether Wolkra should format and mount it for you. If yes, pick the file system (for example ext4).
  5. Give it a name and create it.

You can also add a volume while you create a server.

Automatic format and mount

With automatic mounting, the volume is formatted and mounted on the server, and an entry is added so it mounts again after a reboot. Check on the server:

lsblk
df -h

Format and mount by hand

If you prefer to do it yourself, attach the volume without automatic mounting, then on the server:

lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
ls -l /dev/disk/by-id/

Identify the new, empty disk by its size. In the examples it is /dev/sdb; your device name may differ, so check carefully before formatting.

sudo mkfs.ext4 -L data /dev/sdb
sudo mkdir -p /mnt/data
sudo mount /dev/sdb /mnt/data

Make it permanent with the file system UUID, so device names can change without breaking boot:

UUID=$(sudo blkid -s UUID -o value /dev/sdb)
echo "UUID=$UUID /mnt/data ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab
sudo umount /mnt/data && sudo mount -a && df -h /mnt/data

nofail lets the server boot even if the volume is detached.

Grow a volume

  1. In the console, open the volume and choose Resize. Enter the new size.
  2. On the server, extend the file system:
# ext4 directly on the device
sudo resize2fs /dev/sdb

# XFS
sudo xfs_growfs /mnt/data

Check with df -h. If you created a partition on the volume, grow the partition first with growpart (package cloud-guest-utils), then the file system.

Volumes cannot be shrunk. To use less space, create a smaller volume and copy the data across.

Detach and move

  1. On the server, stop anything that writes to the volume and unmount it:
sudo umount /mnt/data
  1. In the console, choose Detach.
  2. Attach it to another server and mount it there.

Comment out or remove the fstab line on the old server if it will not get the volume back.

Use cases

  • Database data directory: move /var/lib/postgresql or /var/lib/mysql onto a volume, so you can replace or resize the server without copying data.
  • Docker volumes: point Docker's data root or a bind mount at the volume.
  • Uploads and media for WordPress or other apps.
  • Local backup target before files are sent offsite.

Backups and volumes

A volume is a single copy of your data. Include it in your own backups, such as database dumps and restic; see the backup strategy guide and backups and snapshots.

Billing

Volumes are billed per GB per month, per started hour like other resources and capped at the monthly price. A detached volume is still billed until you delete it. See pricing.

API

Volumes are available through the API at https://api.wolkra.com/v1/volumes. See API tokens.

More on the product page: block storage.

Frequently asked questions

How big can a volume be?

From 10 GB to 10 TB. You can grow a volume later, but not shrink it.

Can I grow a volume while it is in use?

Yes. Grow it in the console, then extend the file system on the server. No reboot or unmount is needed for ext4 or XFS.

Can a volume be attached to two servers at once?

No. A volume is attached to one server at a time. Detach it first to move it.

What happens to a volume when I delete the server?

Detach volumes you want to keep before deleting a server, and check the delete dialog. Detached volumes stay in your project and keep being billed until you delete them.