Skip to navigation

Attach and detach a volume

Attaching a volume lets you use it as a new disk, such as /dev/vdb, on one VM. The portal does the attach; you then format the disk once (create a file system on it) and mount it (make it appear as a folder, such as /mnt/data) inside the VM. Before you detach, you unmount it again so no data is lost.

When to attach, detach or move a volume

You want to…Do this
Use a new volume on a VMAttach, format, mount (this page)
Move a volume’s data to another VM in the same locationUnmount, detach, then attach to the other VM — don’t format it again
Stop paying for a volumeUnmount, detach, then delete it. Detaching alone doesn’t stop billing.
Give the volume to a VM in another locationNot possible. Create a new volume there and copy the data.

How it works

  1. Attach in the portal. The volume’s status goes Attaching → In Use, and the portal shows the device path.
  2. Format and mount inside the VM, using the Mount Instructions tab. Format only once, on a new volume.
  3. Unmount inside the VM, then Detach in the portal. The status returns to Ready.

Before you begin

  • A volume with status Ready. See Create a volume.
  • A Cloud VM or GPU VM in the same location as the volume.
  • SSH access to a Linux VM, or Remote Desktop access to a Windows VM, with sudo or Administrator rights.
  • Write access to the workspace (without it, Attach to Server isn’t shown).

Attach a volume

1

Open the volume

In the portal, open Block Storage and click the volume. On the Overview tab, an unattached volume shows Not attached to any server and an Attach to Server button.

2

Choose the VM

Click Attach to Server. In the Attach Volume dialog, under Select Server, pick the VM. The list shows the Cloud VMs and GPU VMs in the volume’s location, each with its status; use Search servers… to filter.

3

Attach

Click Attach to Server. The button shows Attaching…, then the toast Volume “db-data” attached appears. The volume shows In Use, and the Attached To section shows the server and the device, for example Device: /dev/vdb.

Mount the volume on Linux

Open the volume’s Mount Instructions tab. It says Volume is attached — run these commands inside your server., with the kernel device (for example /dev/vdb) and a stable path such as /dev/disk/by-id/virtio-…. Use the stable path in the commands: unlike /dev/vdb, it doesn’t change when you attach more disks. (virtio is the virtual disk driver the VM uses.)

mkfs.ext4 erases everything on the volume. Run it only on a new, empty volume. Skip it for a volume that already has data, such as one moved from another VM.

SSH into the VM and run the commands from the tab. Here DEVICE is the stable path and /mnt/data the folder to mount it on:

DEVICE=/dev/disk/by-id/virtio-PASTE-FROM-THE-TAB
# 1. Check the disk is visible
lsblk -o NAME,SIZE,TYPE,SERIAL,MOUNTPOINTS
ls -l "$DEVICE"
# 2. Format (FIRST TIME ONLY — skip if the volume already has data)
sudo mkfs.ext4 "$DEVICE"
# 3. Create the mount point
sudo mkdir -p /mnt/data
# 4. Mount
sudo mount "$DEVICE" /mnt/data
# 5. Verify
df -h /mnt/data
# 6. Mount again automatically after reboots
UUID=$(sudo blkid -s UUID -o value "$DEVICE")
echo "UUID=$UUID /mnt/data ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab

nofail lets the VM boot even if the volume is detached later.

Verify

df -h /mnt/data shows the volume’s size on /mnt/data, for example:

Filesystem Size Used Avail Use% Mounted on
/dev/vdb 98G 24K 93G 1% /mnt/data

Run sudo mount -a: no output means the /etc/fstab line is correct.

Mount the volume on Windows

For a Windows VM the tab reads Volume is attached — prepare it inside Windows. and shows Disk Management and PowerShell steps.

Initialize-Disk and Format-Volume erase everything on the disk. Run them only on a new, empty volume.

With Disk Management:

  1. Connect to the VM with Remote Desktop.
  2. Open Disk Management (or Server Manager → File and Storage Services → Disks).
  3. Bring the new disk online if it shows as offline.
  4. Initialize it as GPT (new, empty volumes only).
  5. Create a New Simple Volume, assign a drive letter, and format it as NTFS.
  6. Check the drive is Healthy and visible in File Explorer.

With PowerShell (as Administrator), new empty disk:

# 1. Find the newly attached disk and note its Number
Get-Disk | Sort-Object Number | Format-Table Number,FriendlyName,Size,OperationalStatus,PartitionStyle
# 2. Set the disk number from the output above
$DiskNumber = 1
Set-Disk -Number $DiskNumber -IsOffline $false
Set-Disk -Number $DiskNumber -IsReadOnly $false
# 3. New empty disk only: initialize, format, and assign drive F:
Initialize-Disk -Number $DiskNumber -PartitionStyle GPT
New-Partition -DiskNumber $DiskNumber -UseMaximumSize -DriveLetter F | Format-Volume -FileSystem NTFS -NewFileSystemLabel "IBEEData" -Confirm:$false
# 4. Verify
Get-Volume -DriveLetter F

Disk that already has data:

$DiskNumber = 1
Set-Disk -Number $DiskNumber -IsOffline $false
Set-Disk -Number $DiskNumber -IsReadOnly $false
Get-Partition -DiskNumber $DiskNumber | Where-Object DriveLetter -Eq $null | Select-Object -First 1 | Set-Partition -NewDriveLetter F
Get-Volume -DriveLetter F

Detach a volume

Always unmount the volume (Linux) or take the disk offline (Windows) before you detach it. Detaching a mounted volume can corrupt its file system and lose recent writes.

1

Unmount inside the VM

On Linux, run the Unmounting commands from the Mount Instructions tab:

sync # write pending data to disk
sudo umount /mnt/data # unmount
sudo sed -i '/\/mnt\/data/d' /etc/fstab # remove the automatic mount
lsblk # the device should show no mount point

On Windows, close programs using the drive, then in PowerShell as Administrator:

$DiskNumber = (Get-Partition -DriveLetter "F").DiskNumber
Set-Disk -Number $DiskNumber -IsOffline $true
2

Open the Detach dialog

In the portal, open the volume. In Attached To, click Detach. The Detach Volume dialog opens.

3

Confirm and detach

Tick I have unmounted this volume from the server before detaching. (the Detach button stays disabled until you do), then click Detach. The toast Volume detached from … appears and the status returns to Ready.

The volume keeps its data and its charge. You can attach it to any VM in the same location.

Use the API

With a platform API token:

  • Attach: POST /compute/cloud-vms/{vm_id}/actions/attach-volume (GPU VMs: /compute/gpu-vms/{vm_id}/actions/attach-volume) with volume_id and billing_catalog (the sku_id and sku_code of the volume’s plan).
  • Detach: the matching …/actions/detach-volume with volume_id and "confirm_unmounted": true, after you unmount the volume.

Limits

Value
Volume size10 GB to 2,000 GB (set when you create the volume)
VMs per volume1 at a time
LocationThe VM must be in the volume’s location
FormattingOnce, on a new volume only
Default mount folder in the portal’s commands/mnt/data
Billing while detachedContinues until the volume is deleted

Troubleshooting

You seeWhat it meansWhat to do
Your VM isn’t in the Select Server listIt’s in a different location from the volume, or was deletedUse a VM in the volume’s location, or create a volume in the VM’s location.
Select a server in …The chosen VM is in another locationPick a VM in the location named in the message.
No device path on Mount InstructionsThe attach hasn’t finishedWait a few seconds and refresh. The status must be In Use.
lsblk doesn’t list the new diskThe VM hasn’t picked up the diskCheck the status is In Use; if it is, reboot the VM.
mount: wrong fs type, bad option, bad superblockThe volume has no file system yetOn a new volume, run the format step.
The mount is gone after a rebootThe /etc/fstab line is missing or wrongRe-run step 6 and check the UUID with sudo blkid "$DEVICE".
The Detach button is disabledThe unmount box isn’t tickedTick I have unmounted this volume from the server before detaching.
umount: /mnt/data: target is busyA program is still using the folderFind it with sudo lsof /mnt/data, stop it, and unmount again.
Volume detach failedThe detach didn’t completeCheck the volume is unmounted and try again; if it repeats, contact support with the Volume ID.