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

# How to detach additional volumes from virtual machines

You can detach a [secondary disk](./types#disks) or a [shared filesystem](./types#shared-filesystems) from a VM. You cannot detach a boot disk.

## Steps

### Get the disk's device ID or the filesystem's mount tag

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Disks** or <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Shared filesystems**.
    2. Copy the device ID from the list of disks or the mount tag from the list of filesystems.
  </Tab>

  <Tab title="CLI">
    Get the VM's specification:

    ```bash theme={null}
    nebius compute instance get <VM_ID>
    ```

    Alternatively, list all VMs:

    ```bash theme={null}
    nebius compute instance list
    ```

    In the output, you can find device IDs of disks and mount tags of filesystems in `.spec.secondary_disks[].device_id` and `.spec.filesystems[].mount_tag`, respectively:

    ```yaml theme={null}
    spec:
      secondary_disks:
        - attach_mode: READ_WRITE
          existing_disk:
            id: computedisk-***
          device_id: newdisk
      filesystems:
        - attach_mode: READ_WRITE
          existing_filesystem:
            id: computefilesystem-***
          mount_tag: shared-fs
    ```
  </Tab>
</Tabs>

### Make sure that the VM does not mount the volume when the VM restarts

1. [Connect to the VM over SSH](../virtual-machines/connect#connect-to-the-vm-using-ssh).

2. Switch to the `root` user:

   ```bash theme={null}
   sudo su -
   ```

3. If you want to detach a secondary disk, get its UUID:

   ```bash theme={null}
   blkid /dev/disk/by-id/virtio-disk-0-part1 -o export | grep "^UUID"
   ```

   In this example, we assume that you have named the device `disk-0`; for disks, all device IDs are prefixed with `virtio-`.

4. Open `/etc/fstab` with your preferred text editor, for example, `nano /etc/fstab`, and delete the lines that refer to the volumes:

   * The line for a disk should start with its UUID:

     ```text theme={null}
     UUID=<disk_UUID> /mnt/disk-0 ext4 defaults,nofail 0 2
     ```

   * The line for a filesystem should start with the filesystem's mount tag from the VM specification:

     ```text theme={null}
     filesystem-0 /mnt/fs virtiofs rw,nofail 0 0
     ```

     In this example, the filesystem has the mount tag `filesystem-0` and is mounted at `/mnt/fs`.

5. Disconnect from the VM.

### Remove the volume from the VM's specification

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/compute.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=b91340217b08a1456d88ae0347f281d1" width="16" height="16" data-path="_assets/sidebar/compute.svg" /> **Compute** → **Virtual machines**.

    2. Open the page of the required VM.

    3. Click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/square.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=fa5b9d220f12bdedefbdb713438e23c4" width="16" height="16" data-path="_assets/square.svg" /> **Stop VM** and then confirm it.

           <Note>
             You can detach a disk from a running VM, but this can cause data loss or corruption.
           </Note>

    4. After the VM's status becomes `Stopped`, switch to the **Disks** or **Filesystems** tab.

    5. Next to the disk or filesystem, click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> → **Detach**.

    6. After the volume is detached, click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/play.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=bce64b8131f20ec6139c949e67563483" width="16" height="16" data-path="_assets/play.svg" /> **Start VM** and then confirm it.
  </Tab>

  <Tab title="CLI">
    1. Stop the VM:

       ```bash theme={null}
       nebius compute instance stop --id <VM_ID>
       ```

           <Note>
             You can detach a disk from a running VM, but this can cause data loss or corruption.
           </Note>

    2. Start editing the VM specification:

       ```bash theme={null}
       nebius compute instance edit <VM_ID>
       ```

    3. In the text editor that opens, remove the disk or filesystem from the `.spec.secondary_disks` or `.spec.filesystems` list, respectively. If, after that, a list becomes empty, remove it entirely. For example:

       ```diff theme={null}
         spec:
           boot_disk:
             attach_mode: READ_WRITE
             device_id: ""
             existing_disk:
               id: computedisk-***
       -   secondary_disks:
       -     - attach_mode: READ_WRITE
       -       existing_disk:
       -         id: computedisk-***
       -       device_id: newdisk
           gpu_cluster:
         ...
       ```

    4. After making the changes, save the file. The CLI updates the VM automatically.

    5. Start the VM:

       ```bash theme={null}
       nebius compute instance start --id <VM_ID>
       ```
  </Tab>
</Tabs>

You can [attach and mount](./use) different additional volumes to the VM later.
