DewaVPS

Attach Block Storage to Instance

Block Storage volumes can be attached to Instances to add additional storage capacity. This is useful for separating data from the OS disk or expanding storage.

Prerequisites

  • An existing Block Storage volume in your account
  • The volume must be in the same region as the Instance
  • The volume must be available (not attached to another Instance)

Attaching via Control Panel

1. Navigate to Block Storage Tab

  1. Go to InstancesVirtual Machines.
  2. Click on the Instance name.
  3. Select the Block Storage tab.

Block Storage Tab

2. Click Attach

Click the Attach button.

3. Select Volume

Attach Block Storage Dialog

A dropdown shows all available Block Storage volumes in the same region.

Available Volumes Dropdown

4. Confirm

Select the volume and click Confirm.

Volume Selected

Making the Volume Usable

After attaching, the volume is visible to the OS but needs to be formatted and mounted.

1. Identify the Device

lsblk

Look for a new device matching the volume size (e.g., /dev/sdb).

2. Create Filesystem

sudo mkfs.ext4 /dev/sdb

3. Mount the Volume

sudo mkdir /mnt/data
sudo mount /dev/sdb /mnt/data

4. Persistent Mount (Optional)

Add to /etc/fstab:

UUID=your-uuid /mnt/data ext4 defaults,nofail 0 0

Get UUID with:

sudo blkid /dev/sdb

Detaching

Before detaching:

  1. Unmount the volume: sudo umount /mnt/data
  2. Go to Block Storage tab in the Instance detail page
  3. Click Detach

On this page