Block Storage
Block storage is a virtual disk volume attached to a server and formatted with a filesystem (ext4, XFS, and similar). From the application's point of view it looks like a regular disk: you can create folders, write files, and run a database.
Use cases
| Need | Suitable? |
|---|---|
| Extra VPS data | Yes |
| Production database | Yes, with backups |
| Snapshot before an upgrade | Yes |
| File sharing between servers | Not without a cluster filesystem |
| Large public assets | Object storage is a better fit |
Attachment flow
- Create the volume in the provider panel.
- Attach it to the VPS (for example
/dev/vdb). - Format the filesystem.
- Mount it to a folder (
/mnt/data). - Add it to
/etc/fstabso it survives a reboot.
What to watch for
- One volume usually belongs to one server. Multi-attach needs a special filesystem.
- A snapshot is not an offsite backup. Keep a copy somewhere else.
- IOPS decides performance. A cheap disk can be slow for a database.
- Resizing takes two steps. Grow the volume, then grow the filesystem.
- Test restores. A snapshot that has never been restored is not proven.
- Latency differs from a local disk. For sensitive databases, measure IOPS and latency before production.
Do not look only at capacity. For a database, IOPS and latency matter more than disk size. Start with enough volume, monitor usage, and grow before it fills. If the app writes many small files, test filesystem performance before production.
Basic commands after attaching the volume:
lsblk
sudo mkfs.ext4 /dev/vdb
sudo mkdir -p /mnt/data
sudo mount /dev/vdb /mnt/data
df -h /mnt/data
Add /dev/vdb /mnt/data ext4 defaults,nofail 0 2 to /etc/fstab so the volume stays mounted after a reboot.
FAQ
What is the difference between block and object storage?
Block storage works like a disk attached to a server. Object storage is accessed through an HTTP API and is not formatted as a filesystem.
Can block storage be used for a database?
Yes, and that is a common use. Make sure IOPS, backups, and latency match the database requirements.
Is a snapshot the same as a backup?
Not entirely. A snapshot usually lives in the same provider infrastructure. A backup should be copied to a separate location.
Disclaimer: Hosting Wiki articles are prepared for educational and reference purposes. Hosting technology keeps evolving, so some technical details may change over time.