Volumes
Create, attach, resize, and snapshot block storage volumes.
Block storage volumes provide persistent, high-performance storage that can be attached to any VM. Volumes survive VM termination and can be moved between instances.
Overview
| Feature | AWS EBS | DO Volumes | Hetzner Volumes |
|---|---|---|---|
| Min Size | 1 GB | 10 GB | 10 GB |
| Max Size | 16 TB | 16 TB | 10 TB |
| Snapshots | Yes | Yes | Yes |
| Resize | Expand only | Expand only | Expand only |
| Multi-attach | io2 only | No | No |
Creating a Volume
Navigate to Volumes
Go to Virtual Machines > Volumes > New.
Configure
Select the cloud provider, region, and size. Optionally name the volume and choose a filesystem type.
Name: data-vol-01
Provider: Hetzner
Region: fsn1
Size: 50 GB
Filesystem: ext4Create
Click Create. The volume is provisioned in seconds.
Attaching a Volume
Select the Volume
From the volumes list, click the volume you want to attach.
Choose a VM
Select the target VM. The VM must be in the same region as the volume.
Mount Point
Specify where to mount the volume on the filesystem:
/mnt/dataAttach
Click Attach. The volume is mounted automatically if the VM is running.
Volumes can only be attached to one VM at a time (except AWS io2 with multi-attach). Detach first before moving to another instance.
Resizing a Volume
Volumes can be expanded without downtime. Shrinking is not supported.
Select the Volume
Go to Volumes and click the volume to resize.
Enter New Size
Enter the new size. It must be larger than the current size.
Apply
Click Resize. The block device expands immediately.
Extend the Filesystem
If the volume is mounted, the filesystem is extended automatically. For manual extension:
# ext4
sudo resize2fs /dev/sda1
# xfs
sudo xfs_growfs /mnt/dataAlways back up critical data before resizing. While online resize is safe in practice, snapshots provide an extra safety net.
Snapshots
Snapshots capture the state of a volume at a point in time. They are incremental -- only changed blocks are stored.
Creating a Snapshot
Select the Volume
Go to Volumes and click the target volume.
Create Snapshot
Click Snapshots > Create. Enter a name and optional description.
Wait for Completion
Snapshot creation runs in the background. Small volumes complete in seconds; large volumes may take a few minutes.
Restoring from a Snapshot
Select the Snapshot
Go to Volumes > Snapshots and click the snapshot you want to restore.
Create Volume from Snapshot
Click Restore. A new volume is created with the snapshot's data.
Attach
Attach the new volume to a VM as described above.
Detaching and Deleting
Detach a Volume
- Go to the volume detail page
- Click Detach
- The volume is unmounted and disconnected from the VM
Delete a Volume
- Detach the volume first
- Click Delete on the volume detail page
- Confirm deletion
Deleting a volume permanently destroys all data. This action cannot be undone. Create a snapshot first if you may need the data later.
Best Practices
- Name volumes descriptively -- include the purpose and environment (e.g.,
postgres-prod-data) - Snapshot before changes -- always snapshot before OS upgrades or schema migrations
- Monitor disk usage -- set alerts at 80% capacity to avoid out-of-space errors
- Use separate volumes for data -- keep OS and application data on separate volumes for easier backups and migrations
How is this guide?
Last updated on