Creating a VM With Multiple Volumes
Nirvana Cloud VMs can have multiple volumes attached to them.
This is useful for separating the boot volume from the data volume, or for adding additional volumes to the VM.
To create a VM with multiple volumes, simply click on the "Add Volume" button in the "Storage Volumes" section of the VM creation wizard.
You can add up to 6 volumes, and specify the size of each volume.
Keep in mind, you will have to create a partition on the volume and format it before you can use it.
The following commands can be used to create a partition, format it, and mount the volume:
# List the available volumes
lsblk
# Create a partition on the volume (replace /dev/vdb with the appropriate device name if different)
sudo parted /dev/vdb --script mklabel gpt mkpart primary ext4 0% 100%
sudo mkfs.ext4 /dev/vdb1
# Create a mount point and mount the volume
sudo mkdir -p /data
sudo mount /dev/vdb1 /data
# Add the volume to /etc/fstab so it gets mounted on every boot
echo "/dev/vdb1 /data ext4 defaults 0 0" | sudo tee -a /etc/fstab
# Change the owner of the mount point to the ubuntu user
sudo chown -R ubuntu:ubuntu /data
Updated 7 months ago