# ry volume

> Manage durable volumes (persistent block storage).

```text
ry volume [options] [command]
```

## Subcommands

### `ry volume create`

Create a durable volume you can attach to an app.

```text
ry volume create [options] <name>
```

Options:

- `-s, --size <gb>`: Size in GB. Default: `10`.
- `-p, --path <mountPath>`: Guest mount path. Default: `/data`.
- `--class <class>`: Volume class: standard (object-backed) | durable (replicated, later). Default: `standard`.
- `--flush <seconds>`: How often to snapshot to object storage (default daily; minimum 15s, and at least 3s per GB).

Example:

```bash
ry volume create data --size 20
```

### `ry volume resize`

Grow a volume (only upwards) - takes effect at the next cold start of its app (stop and start is enough).

```text
ry volume resize [options] <name> <sizeGb>
```

Example:

```bash
ry volume resize data 50
```

### `ry volume attach`

Attach a volume to an app - its data survives deploys (app must run a single machine).

```text
ry volume attach [options] <name>
```

Options:

- `--to <app>`: The app that will mount it.

Example:

```bash
ry volume attach data --to web
```

### `ry volume detach`

Release a volume from its app - the DATA STAYS, only the binding goes (refused while a machine runs on it: 'ry apps destroy `<app>'` flushes and frees it).

```text
ry volume detach [options] <name>
```

Example:

```bash
ry volume detach data
```

### `ry volume list`

List volumes.

```text
ry volume list [options]
```

Example:

```bash
ry volume list
```

### `ry volume update`

Change the snapshot cadence of a volume - takes effect within seconds, no restart.

```text
ry volume update [options] <name>
```

Options:

- `--flush <seconds>`: How often to snapshot to object storage (e.g. 30m, 2h, daily as 86400; minimum 15s, and at least 3s per GB).

Example:

```bash
ry volume update data --flush 2h
```

### `ry volume destroy`

Destroy a durable volume (irreversible; it must already be detached from a machine).

```text
ry volume destroy [options] <id>
```

Options:

- `-y, --yes`: Confirm without asking (automation, and the way back after consent).

Example:

```bash
ry volume destroy vol-1a2b3c4d --yes
```
