---
title: "Volumes"
description: "Storage that outlives a sandbox's disk."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.jgcp.mistrivedev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Volumes

:::note[Planned]
Volumes are not available yet. The samples show the planned API.
:::

A volume is storage that outlives a sandbox's disk. Use it for data that must survive when a sandbox stops or is deleted, such as datasets, caches and work in progress.

## Attach a volume

Attach volumes when you create a sandbox, in `volumes`. Each entry has a `mountPath` and either:

- `volume`: the name of a volume you created with `volumes.create`, or
- `sizeBytes`: the size of a new inline volume.

Set `readOnly` to mount a volume without write access.

## Inline volumes

An inline volume is created with its sandbox and belongs to it. It is kept while the sandbox is stopped and deleted with the sandbox. Use it for data that one sandbox needs across stops, such as a build cache.

## Volumes on their own

A volume you create with `volumes.create` has its own lifetime. It stays until you delete it, and you can attach it to one sandbox after another. You can also create a volume from a [snapshot](https://docs.jgcp.mistrivedev.com/sandboxes/snapshots/) with `sourceSnapshot`.

## Volumes and stop

A stopped sandbox always keeps its volumes. Files outside a volume are kept only when the sandbox's `preserved` level is `DISK` or higher. See [stop and start](https://docs.jgcp.mistrivedev.com/sandboxes/#stop-and-start).

Source: https://docs.jgcp.mistrivedev.com/sandboxes/volumes/index.mdx
