---
title: "ezgh compute instances detach-volume"
description: "Detach a volume from an instance."
---

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

# ezgh compute instances detach-volume

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh compute instances detach-volume <instance> <volume> [--force [--yes]] [--wait] [flags]
```

Detach a volume (by ID, UUID or name) from an instance; it becomes available. The root volume can't be detached. On a stopped instance it's done at once. On a running instance it's asynchronous and waits for the guest to release the disk (unmount it first): ezgh prints the DetachVolume operation, or with `--wait` waits for it and prints the instance. `--force` frees the volume whether or not the guest releases it, and escalates a detach already under way: force detaching can lose data the instance hasn't written to the volume, and the instance sees I/O errors. Use it only when a normal detach is stuck. `--force` asks first on a terminal; `--yes` confirms otherwise.

Part of [`ezgh compute instances`](/cli/reference/compute-instances).

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--force` | boolean |  | on a running instance, free the volume without the guest (it can lose unwritten data) |
| `--wait` | boolean |  | on a running instance, wait until it's detached, and print the instance then |
| `--wait-timeout` | duration | `10m0s` | how long `--wait` waits |
| `-y`, `--yes` | boolean |  | don't ask for confirmation of `--force` |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/compute-instances-detach-volume/index.mdx
