Skip to main content

Managing Persistent Disks

info

Crusoe Cloud is currently in private beta. If you do not currently have access, please request access to continue.

Creating Persistent Disks

Use the storage disks create command to create a disk with your size. In the example below we will create 100 GiB disk called "data-1."

crusoe storage disks create \
--name data-1 \
--size 100GiB \
--location us-northcentral1

name, size, and location are required arguments. The location can be either "us-northcentral1" or "us-east1". When attaching a disk to a VM, the disk must be in the same location as the VM.

Attaching Persistence Disks

Once the disk is created above we can attach and the disk to an instance. In both cases the instance must be in the stopped state.

Use the compute vms attach-disks command to attach a disk to an instance. You can attach multiple disks to an instance with this command as well using a comma separated list of disk names.

crusoe compute vms attach-disks my-vm --disks data-1

Formatting and Mounting Persistent Disks

Once the instance is started, login and use the command lsblk to inspect the available disks attached to the instance. These persistent ssd disks will have the vd[b-z] name. In situations where you have multiple disks with the same size, to associate which disk name corresponds to which disk in the consle you can navigate to /dev/disk/by-id you will see the id after virtio-... matches the serial number for that disk in the console. For example:

lrwxrwxrwx 1 root root  9 Jun 14 17:52 virtio-39734E8567D2ECA55C1 -> ../../vdb

39734E8567D2ECA55C1 matches the serial number in the Crusoe Cloud Instance details console.

Create the filesystem on the block device by running:

mkfs.ext4 /dev/vdb

Mount the volume by creating a /scratch directory and mouting /dev/vdb to /scratch

mount -t ext4 /dev/vdb /scratch

Some additional mount options exist within the ext4 filesystem by passing -O ... for example -O noatime,nodiratime,data=writeback will avoid writing access times, as well disabling journaling if your workloads can benefit from these optimizations.