> For the complete documentation index, see [llms.txt](https://docs.denvrdata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.denvrdata.com/docs/platform/storage/block-storage.md).

# Block storage

Block storage provides persistent volumes that you attach to your virtual machines. A volume keeps its data independently of any VM, so it suits application data, databases, datasets and backups that must outlive a single machine.

**Access:** Block Storage in the left menu

***

#### Create a volume

1. Open **Block Storage** and click **Create Block Storage**.
2. Enter a **name** and a **size** between 10 and 10,240 GiB (10 TiB), and choose the VPC.
3. Optionally add **tags** to organize your volumes.

Names can contain lowercase letters, digits and hyphens, must start and end with a letter or digit, and can be up to 52 characters long. A name can't be changed after the volume is created.

{% hint style="info" %}
Block storage is not available on every cluster. If a cluster doesn't support it, the console tells you when you create a volume or deploy a VM.
{% endhint %}

#### Attach a volume

You can attach a volume in two ways:

* **When you deploy a VM:** select the volumes in the storage section of the deployment page. They appear in the order summary before you launch.
* **To an existing VM:** attach the volume from the Block Storage page or from the VM's details page. The VM can keep running.

A volume can be attached only to VMs in its own VPC, and to only one VM at a time.

#### Use the volume inside the VM

A new volume arrives as a raw block device with no filesystem. To find it, run:

```bash
lsblk -o NAME,SERIAL
```

The `SERIAL` column shows the volume's name. On first use, format the device and mount it, for example:

```bash
sudo mkfs.ext4 /dev/vdX
sudo mkdir -p /mnt/data
sudo mount /dev/vdX /mnt/data
```

Replace `/dev/vdX` with the device that `lsblk` shows for your volume. To mount it automatically after a reboot, add it to `/etc/fstab`. See [Adding DAS to /etc/fstab](https://docs.denvrdata.com/docs/additional-information/faqs/adding-das-to-etc-fstab) for an example.

#### Detach a volume

Unmount the volume inside the VM first to avoid data loss, then detach it from the Block Storage page or the VM's details page. The volume and its data are kept, and you can attach it to another VM in the same VPC.

#### Resize a volume

Select **Resize** and enter a larger size, up to 10,240 GiB. Volumes can only grow.

Resizing enlarges the block device but not the filesystem on it. Grow the filesystem inside the VM afterwards, for example with `resize2fs` for ext4 or `xfs_growfs` for XFS.

#### Resize a VM's root disk

A VM's root disk can also be enlarged, from the VM's details page. After the resize completes, grow the partition and filesystem inside the VM, for example with `growpart` and `resize2fs`, or reboot the VM to use the added capacity.

#### Tags

Add up to 50 `key=value` tags to a volume. You can filter the Block Storage list by tag: `key` finds volumes that have the key, and `key=value` finds an exact match.

#### Delete a volume

Detach the volume first; an attached volume can't be deleted. Then select **Delete** and type the volume's name to confirm. Deleting a volume permanently erases its data.

A VM's root disk can't be deleted on its own. It is removed when you delete the VM.

***

#### Supported operations

| Operation                                            | Supported        |
| ---------------------------------------------------- | ---------------- |
| Attach and detach volumes, including on a running VM | ✅                |
| Expand a volume                                      | ✅                |
| Expand a VM's root disk                              | ✅                |
| Move a volume to another VM in the same VPC          | ✅                |
| Attach one volume to several VMs at once             | ❌                |
| Shrink a volume                                      | ❌                |
| Rename a volume                                      | ❌ (use tags)     |
| Delete an attached volume                            | ❌ (detach first) |
| Delete a root disk separately from its VM            | ❌                |

#### Pricing

Block storage is billed per GB per month for as long as the volume exists, whether or not it is attached. See [Storage pricing](https://docs.denvrdata.com/docs/platform/billing#storage-pricing).

***

#### Frequently asked questions

**Why doesn't my new volume show a filesystem?** New volumes are raw block devices. Format and mount the volume before using it, as shown in Use the volume inside the VM.

**Why don't I see the extra space after resizing?** Resizing enlarges only the block device. Grow the filesystem inside the VM to use the new capacity.

**Can I move a volume to another VM?** Yes. Unmount and detach it, then attach it to another VM in the same VPC.

**Can I attach one volume to several VMs?** No. A volume can be attached to only one VM at a time.

**Can I rename or shrink a volume?** No. Names can't be changed after creation (use tags to organize volumes), and volumes can only grow.
