Attach a volume to a cluster machine
Learn how to attach your volume to a cluster machine and mount it
Attach a volume to a cluster machine
To attach a volume to a cluster machine, you will need to have an existing volume and a cluster machine. If you haven't created a volume yet, see Create a volume. If you haven't created a cluster yet, see Create a cluster.
Once you have both a volume and a cluster, attach the volume to a cluster machine by following these steps:
- Navigate to the project you wish to attach a volume to.
- Click Clusters in the navigation menu.
- Click on the cluster you wish to attach the volume to.
- Click on the dropdown next to the cluster machine you wish to attach the volume to.
- Click on Attach volume.
- Select the volume you wish to attach from the dropdown.
- Click Attach volume.
This will ensure that the volume is available to the cluster machine and can be mounted.
Mounting a volume
Once a volume is attached to a cluster machine, you will need to mount it to read and write data. Establish an SSH connection with the cluster machine using the ssh
command and run the following commands:
- Install the necessary Network File System (NFS) dependencies:
sudo apt install nfs-common
- Create a directory on the system where you will mount your storage volume:
sudo mkdir /data
- Add a record to the File Systems Table (
/etc/fstab
) to ensure the volume is automatically mounted when the cluster machine is restarted. The value for<IP address>
can be found on the Volumes page in the CUDO Compute console.<IP address>:/data /data nfs rw,nconnect=16,nfsvers=3 0 0
- Once you have updated the configuration in
/etc/fstab
run the following command to mount the volume:sudo mount -a
- To confirm that the volume mounted correctly, run the following command to see if the target directory (
/data
) has successfully mounted the storage volume:df -h
Unmounting the volume
You may want to unmount a volume from a cluster machine if you plan to delete or replace the volume.
Run the umount command to unmount the volume:
sudo umount /data
Remove the record for the volume from the File Systems Table (/etc/fstab
) to prevent it from being automatically mounted when the cluster machine is restarted.