OneQode

Automatically mount a volume

How to create, attach, and configure a volume in OCS

Last updated: 1/23/2026

Here’s how to create a volume in your OCS OneQode Cloud Services account, attach it to an instance, and configure the settings to make it accessible.

Create a volume in your OCS account

From the OCS dashboard, navigate to Cloud → Volumes in the left hand navigation panel, then click the ”+” button in the bottom right corner to create a volume.

Create volume button

Enter/select the values you like in each field. Then click “Create”.

Volume creation form

You will see the new volume on the list.

Volume list

Attach the new volume to an instance

In Cloud → Instances, open the instance which you want to attach the volume to.

Instance list

Navigate to “Volumes” in the horizontal tab and click the “Attach Volume”. Choose the volume you want to attach and then click “Attach”.

Attach volume dialog

After attaching the volume, you will see the attached volume show up in the list.

Attached volume in list

Configuring your instance

Just attaching a volume to an instance doesn’t let the operating system to read/write files on the volume. To make it accessible to a volume, you need to format and mount the volume.

Format the volume

Open the console of the instance to which you attached the volume.

ℹ️

While you can do the below step via the console in the OneQode Cloud dashboard, we recommend doing this step via SSH as you’ll need to copy and paste some values later.

Accessing the console from within the OneQode Cloud dashboard

Enter the command lsblk and take note of the volume’s name for the next step.

lsblk output

Create an ext4 filesystem on the volume with the command mkfs.ext4 /dev/*** (replacing *** with the volume name). Make sure you prepend /dev/ to the volume’s name.

Take note of the “Filesystem UUID”. You need this UUID to configure the mounting setting later.

mkfs.ext4 output showing UUID

Configure the mounting setting

Create the directory to which you want to mount the volume. In this guide, we will use /testmount as the mounting point.

To do this run the command sudo mkdir /testmount

mkdir command

Open “/etc/fstab” with a text editor (you can do this by running the command sudo nano /etc/fstab) and configure the mounting setting as in the below image.

Change the UUID and /testmount depending on your environment.

fstab configuration

Finally, enter the mount -a command to mount the volume to /testmount.

ℹ️

You can check if the volume is properly mounted with the lsblk command.

Your system is now configured to automatically mount the volume and begin reading and writing files to the new storage space.

ℹ️

Having trouble? Reach out to our team if you have any problems.