Skip to main content

Connect and disconnect a volume from a cloud server

Replace a boot volume

You can only replace a networking boot volume on a cloud server with another network volume.

  1. In the control panel, in the top menu, click Products and select Cloud Servers.
  2. Open the server page → Network volumes tab.
  3. Check which volume is the boot volume — in its row, you will see the Bootable tag.
  4. If the cloud server does not have a boot volume, attach the required volume first — it will automatically become the boot volume.
  5. If the cloud server already has a boot volume, shut down the server and detach the boot volume. First, attach the required volume — it will automatically become the boot volume.

Connect a network volume to the server

Only network volumes can be connected to the cloud server (up to 255 volumes per server).

If the cloud server has no boot volume, the first connected volume will automatically become the boot volume.

The volume to be connected and the cloud server must be located in the same pool segment.

  1. Make sure that the volume is not attached to other servers, and, if necessary, detach it.
  2. We recommend that you shut down the server. You can also attach the volume to a running server, but make sure that the operating system is fully loaded.
  3. In the control panel, in the top menu, click Products and select Cloud Servers.
  4. Go to the Volumes section.
  5. In the volume row, in the Attached to column, click Attach.
  6. Select the server to which the volume will be attached. The volume and server must be in the same pool segment — if necessary, transfer the volume to another pool segment.
  7. Click Attach.
  8. If you attached the volume as an additional one, make sure to prepare it for use — format and mount it.

Prepare an additional volume for use after connection

If you have connected an additional volume to a cloud server, you must format and mount it; the setup procedure depends on the operating system.

  1. Connect to the server.

  2. Find the name of the additional volume connected to the server:

    lsblk

    In the response, sdb is the additional volume:

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 8G 0 disk
    ├─sda1 8:1 0 8G 0 part /
    └─sda14 8:14 0 8M 0 part
    sdb 8:16 0 5G 0 disk
  3. If the connected volume was created from a source (image, snapshot, backup, or another volume), proceed to step 12.

  4. If the volume is empty, run the parted utility to create a file system and partitions on the additional volume:

    parted /dev/sdb

    Here, sdb is the additional volume.

  5. Create a partition table with GPT layout:

    mklabel gpt
  6. Create partitions using the mkpart utility, specifying the start and end of the partition:

    mkpart primary 0 1GB
    mkpart primary 1GB 3GB

    In the example, the first partition created is 1 GB in size, and the second is 2 GB (sector from 1 GB to 3 GB).

  7. Check the created partition table:

    print

    The response will show a list of partitions, their start and end sectors, and partition sizes.

  8. Exit the parted utility:

    quit
  9. If when exiting parted you see the warning Information: You may need to update /etc/fstab, copy the IDs of all partitions of the additional volume (the PARTUUID parameter):

    blkid

    In the response, sdb1 and sdb2 are the volume partitions, and PARTUUID represents the partition IDs:

    /dev/sdb2: PARTLABEL="primary" PARTUUID="bd032abc-8f4e-4723-8ffd-a39544e97e36"
    /dev/sdb1: PARTLABEL="primary" PARTUUID="123e46a1-61a4-3a53-77d7-14a02fbc98bc"
  10. Open the /etc/fstab file:

    nano /etc/fstab
  11. Add the ID of each partition to the file:

    PARTUUID=<block_id_1> /mnt ext4 defaults 0 0
    PARTUUID=<block_id_2> /mnt ext4 defaults 0 0

    Specify <block_id_1> and <block_id_2> — the IDs of the additional volume partitions copied in step 9.

  12. Format each partition of the volume using the mkfs utility (the ext4 partition format is used):

    mkfs.ext4 /dev/sdb1
    mkfs.ext4 /dev/sdb2

    Here, sdb1 and sdb2 are partitions of the additional volume.

  13. Create a directory for mounting the additional volume and mount each partition to it:

    mkdir -p /mnt
    mount /dev/sdb1 /mnt
    mount /dev/sdb2 /mnt

    Here, sdb1 and sdb2 are partitions of the volume.

  14. Check the result:

    lsblk

    The response will show the partitions of the additional volume:

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 8G 0 disk
    ├─sda1 8:1 0 8G 0 part /
    └─sda14 8:14 0 8M 0 part
    sdb 8:16 0 5G 0 disk
    ├─sdb1 8:17 0 953.7M 0 part /mnt
    └─sdb2 8:18 0 1.9G 0 part /mnt

Disconnect a network volume from the server

Only a network volume — whether boot or additional — can be disconnected from a cloud server.

  1. Shut down the cloud server to detach the boot volume. For an additional volume, we also recommend shutting down the server. You can also detach an additional volume from a running server, but make sure that the operating system is fully loaded.
  2. In the control panel, in the top menu, click Products and select Cloud Servers.
  3. Go to the Volumes section.
  4. From the menu of the volume, select Detach from server.
  5. Enter the server name.
  6. Click Detach.