This page shows how to attach and detach additional volumes to an existing server.
Each BareMetal Cloud Server can have up to 15 volumes, including the root volume.
The type of disk to host your volumes usse the LSSD technology: Local solid state drive, to deliver fast disk I/O.
Note: Flexible Volumes are available on BareMetal Cloud Servers. For Virtual Cloud Servers the volume size is fixed, depending on the offer.
LSSD volumes are transferred close to your server.
When you start a server for the first time, your volume files are downloaded from the volumes store to the local storage devices (LSSD).
Each time you start or stop a server, the volumes are downloaded or uploaded to the volumes store. The larger the amount of data to transfer, the longer the upload or download duration.
We work constantly on optimizing the transfer time of local storage devices to the volumes store.
There are five steps to attach a volume to an existing server
Important: A Server must be powered off to attach or detach a volume.
In the Control Panel, click “Volumes” in the compute section.
Click the “Create Volume” button.
You will land on the volume-creation page where you must input basic information for your volume:
In the servers page, click on the server you want to attach a volume to.
On the server detail page click “Attach an existing volume” and select the volume to attach in the list.
Important: To detach the volume, click the Detach button.
Once the volume is attached to your server, you can use
lsblk to determine its name. Please note that the name might be different depening on the instance type you use. It might be something like
/dev/nbdX for a BareMetal instance or
/dev/vdX for a Virtual Cloud server.
As exemplified below, the additional volume is named vdb:
root@scw-8838b4:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 252:0 0 46.6G 0 disk |-vda1 252:1 0 46.5G 0 part / `-vda15 252:15 0 100M 0 part /boot/efi vdb 252:16 0 46.6G 0 disk
If the new volume has never been formatted, you need to format the volume using
mkfs before you can mount it.
For instance, the following command creates an
ext4 file system on the volume:
To mount the device manually as /mnt/data, run the following commands:
To mount the additional volume automatically, you can create a systemd script that will mount your volumes automatically during the boot of your cloud server.
If not yet done, create the directory into you want to mount your volume:
mkdir -p /mnt/data
As the volume is empty by default, you have to create a filesystem before you can use it. To format it with with an
ext4 filesystem, use the following command:
mkfs -t ext4 /dev/nbd1
To get the
UUID of your volume, run the command
blkid and take a note of the ID as you will need it in the next step.
Create or edit the file that corresponds to the path of your directory
nano /etc/systemd/system/mnt-data.mount and edit is as following: The file name of the script must correspond to the path where you mount the volume (
UUID with the ID of your volume.
Now reload systemd:
systemctl daemon-reload Launch the script to mount the volume:
systemctl start mnt-data.mount Finally enable the script to mount your volume automatically during boot:
systemctl enable mnt-data.mount
Your volume will automatically be mounted after a reboot. You can run the
df -h command, this command will list all your devices and where they are mounted: