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, on 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 the row with it, you will see the Boot tag.
  4. If the cloud server does not have a boot volume, first connect the required volume — it will automatically become the boot volume.
  5. If the cloud server already has a boot volume, turn off the server and disconnect the boot volume. First, connect 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 the volume is not connected to other servers, and disconnect it if necessary.
  2. We recommend turning off the server. You can connect a volume to a running server, but make sure the operating system has fully booted.
  3. In the Control panel, on the top menu, click Products and select Cloud Servers.
  4. Go to the Volumes section.
  5. In the row with the volume, in the Connected to column, click Connect.
  6. Select the server to which the volume will be connected. The volume and the server must be located in the same pool segment — move the volume to another pool segment if necessary.
  7. Click Connect.
  8. If you connected 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, specify 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 a warning appears when exiting parted saying Information: You may need to update /etc/fstab, copy the IDs of all additional volume partitions (the PARTUUID parameter):

    blkid

    In the response sdb1 and sdb2 are volume partitions, PARTUUID are 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> — IDs of the additional volume partitions copied in step 9.

  12. Format each partition of the volume using the mkfs utility (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 volume partitions.

  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. If the volume is a boot volume, turn off the cloud server.
  2. If the volume is an additional one, we also recommend turning off the server. You can disconnect a volume from a running server, but make sure the operating system has fully booted.
  3. In the Control panel, on the top menu, click Products and select Cloud Servers.
  4. Go to the Volumes section.
  5. In the volume menu, select Disconnect from server.