> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Volumes

> Persistent storage that exists independently of sandboxes and can be mounted across multiple sandboxes.

<Note>
  Volumes are currently in private beta.
  If you'd like access, please reach out to us at [support@e2b.dev](mailto:support@e2b.dev).
</Note>

Volumes provide persistent storage that exists independently of sandbox lifecycles. Data written to a volume persists even after a sandbox is shut down, and volumes can be mounted to multiple sandboxes over time.

**One volume shared across multiple sandboxes**

```mermaid actions={false} theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
graph LR
  V1[Volume A] --- S1[Sandbox 1]
  V1 --- S2[Sandbox 2]
  V1 --- S3[Sandbox 3]
```

**Each sandbox with its own volume**

```mermaid actions={false} theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
graph LR
  V2[Volume A] --- S4[Sandbox 1]
  V3[Volume B] --- S5[Sandbox 2]
```

**Standalone usage via SDK**

```mermaid actions={false} theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
graph LR
  SDK[SDK] --- V4[Volume A]
  SDK --- V5[Volume B]
```

When a volume is mounted to a sandbox, files can be read and written directly at the mount path. The SDK methods are meant to be used when the volume is not mounted to any sandbox.

With E2B SDK you can:

* [Manage volumes.](/docs/volumes/manage)
* [Mount volumes to sandboxes.](/docs/volumes/mount)
* [Read and write files to a volume.](/docs/volumes/read-write)
* [Get file and directory metadata.](/docs/volumes/info)
* [Upload data to a volume.](/docs/volumes/upload)
* [Download data from a volume.](/docs/volumes/download)

## Example

<CodeGroup>
  ```js JavaScript & TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  import { Volume, Sandbox } from 'e2b'

  const volume = await Volume.create('my-volume')

  const sandbox = await Sandbox.create({
    volumeMounts: {
      '/mnt/my-data': volume,
    },
  })
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  from e2b import Volume, Sandbox

  volume = Volume.create('my-volume')

  sandbox = Sandbox.create(
      volume_mounts={
          '/mnt/my-data': volume,
      },
  )
  ```
</CodeGroup>
