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

# vers resize

> Grow a VM's root disk. One-way: new size must be larger than current.

`vers resize` grows a VM's root disk. The new size is specified in MiB and must be strictly greater than the current size.

<Warning>
  Resize is **one-way**. You can only grow a disk, never shrink it. Plan conservatively.
</Warning>

## Synopsis

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize --size <mib>                   # Resize HEAD
vers resize <vm-id|alias> --size <mib>     # Resize specific VM
vers resize --size 4096 --format json
```

## Options

| Option          | Description                                                                |
| --------------- | -------------------------------------------------------------------------- |
| `--size`        | New disk size in MiB. **Required.** Must be greater than the current size. |
| `--format json` | Machine-readable output                                                    |

## Examples

### Grow HEAD to 4 GiB

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize --size 4096
```

### Grow a specific VM

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize my-db-vm --size 8192
```

### Script-friendly

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize vm-abc123 --size 8192 --format json | jq '.new_size_mib'
```

## How it works

<Steps>
  <Step title="Server-side resize">
    Vers extends the backing block device to the new size.
  </Step>

  <Step title="Filesystem growth">
    The guest filesystem is resized online — no reboot required.
  </Step>

  <Step title="Verify">
    Inside the VM, `df -h /` (or `lsblk`) shows the new capacity.
  </Step>
</Steps>

## Common reasons to resize

* A build or install is about to write more than the default `fs_size_vm_mib`.
* You branched a VM that filled its disk and need headroom on the branch.
* You're materializing a large dataset (database dump, container image layers) for testing.

## Common Patterns

### Grow before a big install

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize --size 8192
vers execute -- apt-get install -y heavy-package
```

### Check then grow

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
CURRENT=$(vers info my-vm --format json | jq -r .resources.fs_size_mib)
echo "current: $CURRENT MiB"
vers resize my-vm --size $(( CURRENT * 2 ))
```

### Verify inside the VM

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers resize --size 4096
vers execute -- df -h /
```

## See also

* [vers run](/cli-reference/run) — set initial `--fs-size-vm` when creating a VM
* [vers info](/cli-reference/info) — inspect current resources including disk size
* [vers branch](/cli-reference/branch) — branches inherit the parent's disk size
