For the complete documentation index, see llms.txt. This page is also available as Markdown.

Detach a volume from a virtual machine

Before detaching a volume from a virtual machine, make sure to unmount it from the operating system first.


Before detaching a volume from a virtual machine, it's always safest to unmount the volume to avoid data loss. If you are running Linux, you should also remove any automounting of the volume that can prevent the system from booting without the volume. This is especially important if you are automounting the volume via /etc/fstab and not using the nofail option.

Unmount the volume in the operating system

Start by looking up the WWN of the volume you want to detach. You can find the WWN for attached block storage volumes on the Block storage overview page, on each volume's overview, and on the Block storage tab on the VM overview.

Navigate to Storage → Block storage. Here you'll see the WWN of all attached volumes.

If you click on one of the volumes, you'll also find the WWN on that volume's overview.

If you prefer to look at the VM's overview, you can find the WWN under the Block storage tab.

Performing the unmount

Once you have found the WWN and noted it down, it's time to unmount it from the operating system.

List all the current drives and volumes using lsblk to identify the volume by its WWN.

In this example, the mount point /mnt/volume1 is using the volume with the matching WWN.

Start by unmounting the volume.

Then, disable automatic mounting of the volume by commenting out (with a #) or deleting the corresponding line in /etc/fstab. In our example, the line to delete will look like this.

Start a PowerShell terminal and run the following command (search for Terminal or PowerShell in the Start menu).

Execute Get-Disk and look for the WWN shown in the control panel and match it to a disk.

In this example, disk number 1 matches the WWN from the control panel.

Open Computer Management by searching for it in the Start menu.

Once inside Computer Management, select Disk Management under Storage. Right-click on the disk number that corresponds to the WWN from the previous step (in this case, Disk 1). Select Offline.

Start a PowerShell terminal and run the following commands (search for Terminal or PowerShell in the Start menu).

Execute Get-Disk and look for the WWN shown in the control panel and match it to a disk.

In this example, disk number 1 matches the WWN from the control panel.

Use Set-Disk to take the volume offline. Use the disk number from the above step.

Detach the volume from the VM

You can detach the volume from two places in the control panel: from the VM's Block storage tab, and from the block storage volume's overview. Choose the most convenient option for you.

In the control panel, navigate to Compute → Virtual machines. Click on the VM. Then, click on the Block storage tab. Click the three dots next to the volume. Click Detach.

In the dialog that opens, click Detach.

In the control panel, navigate to Storage → Block storage. Click on the volume. Click Detach.

In the dialog that opens, click Detach.

Last updated

Was this helpful?