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

# Block storage

{% hint style="info" %}
Block storage requires a quota to be added to your account. For access, contact your account team via Slack or email <support@mithril.ai>
{% endhint %}

Block storage gives you the most control over your storage approach by providing a blank disk that can be attached to your instances. Block storage typically requires a more lengthy setup. If you need shared storage across multiple instances, we recommend using [file share storage](/compute-and-storage/persistent-storage/file-shares.md) instead.

{% hint style="danger" %}
Block storage volumes are **single-writer**. You can only mount a volume read-write from **only one instance at a time**. Mounting the same volume read-write from multiple instances is unsupported and will likely cause filesystem and data corruption.

The only supported multi-instance pattern is mounting the volume **read-only**, with **no concurrent write mounts**. For more details, please contact support.
{% endhint %}

## Provisioning block storage

To provision block storage, go to **Storage**, select **+ Create Storage**, and select **Block**.

1. Select the region you would like to provision your Block storage in.
2. Select the size for your disk. Currently, each block storage disk has a **maximum size of 32TB.**

   NOTE: instances in us-central2-a have 15TB and instances in us-central2-b have 12.5TB of ephemeral storage.

{% hint style="info" %}
Tip: Give your disks different sizes to make it easier to find the disk you're looking for inside your VM.
{% endhint %}

## Attach storage to reservations and spot bids

Provisioned storage is available for selection while creating a reservations or spot bid. You can attach as many storage options as needed from the same region. If you select a region that does not have provisioned storage, it will not appear as an option.

For existing instances, you can attach/detach storage volumes when the instances are in a Paused state. You will need to manually mount the new volumes.

{% hint style="warning" %}
Currently, it's not possible to shrink/expand disk size.
{% endhint %}

## Using the disk from your instance

<details>

<summary>Find the disk device name(s) using lsblk</summary>

List your block devices with lsblk. Your selected disks will start from vdd and extend to however many you added in order alphabetically.

```bash
$ lsblk
```

</details>

<details>

<summary>First time only - format the disks</summary>

If this is the first time using this disk, you will need to format and define a filesystem. In the below command:

* Replace `/mount/dir/path` with the local directory where you want the disk mounted
* Replace `/dev/name` with the disk name selected from the output of `lsblk`

⚠️ Running this command will erase the disk content if previously mounted ⚠️

```bash
sudo mkdir -p /mount/dir/path
sudo mkfs.ext4 /dev/name
```

Repeat this for all disks you are formatting.

</details>

<details>

<summary>Mount the disks</summary>

Finally, mount the disk with the below, replacing `/dev/name` and `/mount/dir/path` with the local directory of where the disk will be mounted and the disk name

```bash
sudo mount -t ext4 /dev/name /mount/dir/path
sudo chown -R $USER:$USER /mount/dir/path
```

Repeat this for all disks you are mounting.

</details>

<details>

<summary>Persist mounted disks across reboots</summary>

1. Get the `UUID` of your disks

```bash
sudo blkid
```

2. Open `/etc/fstab` in your text editor

```bash
sudo vim /etc/fstab
```

3. Add the disk to your `fstab`

```bash
# Example template
UUID=DISK_UUID MOUNT_POINT ext4 OPTIONS <dump> <pass> 
```

It looks something like this. We strongly recommend using the `nofail` option to prevent instance failure in case of disk failure or disk removal.

```bash
UUID=f124a6dc-a10f-4ff4-81cd-6a3990c1aa7d /mnt/disk ext4 defaults,nofail 0 2 
```

4. Save and mount

```bash
sudo mount -a
```

</details>

## Quotas

Each project has a total storage capacity quota that accumulates usage across all regions. Contact your account team via Slack or email <support@mithril.ai> to increase your quota.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mithril.ai/compute-and-storage/persistent-storage/block-storage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
