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

# Disks

> CLI reference for creating, inspecting, listing, and removing persistent disks (experimental).

<Warning>
  Disks are an **experimental** feature. The `disks` commands are hidden by
  default — run `machine0 config set USE_EXPERIMENTAL_FEATURES=true` to enable
  them.
</Warning>

Disks are persistent block storage volumes tied to a region. A disk can
be mounted on one VM at a time, at VM creation, and its data survives
suspend/resume and VM destruction — the disk keeps living (and billing) until
you remove it. Disks are billed per GB-hour while they are `READY`
(\~\$0.1667/GB/month).

Disks are durable but **not backed up** — removing a disk (or deleting files
on it) is permanent.

## disks new

Create a disk. The command returns immediately with the disk in a `CREATING`
state; it becomes `READY` on its own, usually within seconds (check with
`disks ls`).

```bash theme={"theme":"css-variables"}
machine0 disks new <name> --size <gb> [--region <region>]
```

| Flag                    | Description              | Default             |
| ----------------------- | ------------------------ | ------------------- |
| `-s, --size <gb>`       | Disk size in GB (10–500) | required            |
| `-r, --region <region>` | Region the disk lives in | your default region |

```bash theme={"theme":"css-variables"}
$ machine0 disks new data --size 50 --region eu
✓ Disk "data" is being created (50 GB, eu)

   Check status:  machine0 disks ls
   Once READY, mount it on a new VM:  machine0 new <vm> --mount disk:data path:/data
```

Disk names use lowercase letters, numbers, and hyphens (max 31 characters).
Each account can have up to 10 disks. A disk can only be mounted on VMs in
its own region.

***

## disks ls

List your disks.

```bash theme={"theme":"css-variables"}
machine0 disks ls
```

| Flag     | Description | Default |
| -------- | ----------- | ------- |
| `--json` | Output JSON | off     |

```bash theme={"theme":"css-variables"}
$ machine0 disks ls
┌──────┬────────┬───────┬────────┬────────┬────────────┐
│ Name │ Status │ Size  │ Region │ In Use │ Created    │
├──────┼────────┼───────┼────────┼────────┼────────────┤
│ data │ READY  │ 50 GB │ eu     │ dev1   │ 2026-07-11 │
└──────┴────────┴───────┴────────┴────────┴────────────┘
```

`In Use` names the VM the disk is currently attached to. A disk in `ERRORED`
state failed to provision — run `disks get <name>` for the error, then
`disks rm <name>` to clean it up and create it again.

***

## disks get

Show a disk's details — status, size, region, and which VM mounts it.

```bash theme={"theme":"css-variables"}
machine0 disks get <name>
```

| Flag     | Description | Default |
| -------- | ----------- | ------- |
| `--json` | Output JSON | off     |

```bash theme={"theme":"css-variables"}
$ machine0 disks get data
DISKS > data

  Status   READY
  Size     50 GB
  Region   eu
  Mounts   dev1:/data
  Created  2026-07-11
```

For `ERRORED` disks the provider error is shown (for example, a volume quota
being exhausted) so you know whether recreating will help.

***

## disks rm

Remove a disk and **all of its data**, permanently. Refused while any VM
(including a suspended one) still mounts the disk — destroy the VM first.

```bash theme={"theme":"css-variables"}
machine0 disks rm <name>
```

| Flag        | Description                  | Default |
| ----------- | ---------------------------- | ------- |
| `-y, --yes` | Skip the confirmation prompt | off     |

```bash theme={"theme":"css-variables"}
$ machine0 disks rm data -y
✓ Disk "data" destroyed
```

The command returns immediately — the disk disappears from `disks ls` at once
and its name is instantly reusable, while the volume is deleted in the
background. `disks rm` also works on `CREATING` disks (cancels provisioning)
and `ERRORED` disks (cleanup).

***

## Mounting disks: `new --mount`

Mount disks when creating a VM with the repeatable `--mount` flag on
[`machine0 new`](/cli/machines#new) — the same flag used for
[folders](/cli/folders). Each use takes two values: the disk and the absolute
path to mount it at.

```bash theme={"theme":"css-variables"}
machine0 new <vm> --mount disk:<name> path:</abs/path>
```

```bash theme={"theme":"css-variables"}
# one disk
machine0 new dev1 --mount disk:data path:/data

# mix disks and folders
machine0 new dev1 \
  --mount disk:data path:/data \
  --mount folder:code path:/code
```

Mount paths must be absolute (letters, numbers, `/`, `_`, `-`), cannot be
inside system directories (`/etc`, `/usr`, `/var`, ...), and cannot be nested
inside one another (e.g. `/data` and `/data/code`) — this applies across all
mounts on the VM, disks and folders alike. The disk must be
`READY`, in the same region as the VM, and not attached to another VM. Up to
5 disks can be mounted per VM. Mounts survive reboots and suspend/resume —
on resume the disk is re-attached with its data intact — and are set only at
VM creation for now. Disks are not yet supported on GPU sizes.
