Ephemeral disks are temporary storage devices that are often used for short-term data storage. These disks may not show up in the df -h
output even though they appear in lsblk
, this can be due to missing configuration that needs to be part of the startup script to automatically detect the number of ephemeral disks and create an ext4 file system mounted at the /nvme
path. If multiple ephemeral disks are found, the script will create a RAID0 array of the disks for additional performance benefits, mounted at the /raid0
path.
Symptoms
When performing lsblk command, output:
When performing df -h command, output:
Prerequisites
- Applicable to instance types that support ephemeral disks.
Solution
Create a new instance with the below startup script:
#!/bin/bash
apt update && apt install -y nvme-cli mdadm
num_nvme=`nvme list | grep -i /dev | wc -l`
if [[ $num_nvme -eq 1 ]]; then
dev_name=`nvme list | grep -i /dev | awk '{print $1}'`
mkfs.ext4 $dev_name
mkdir /nvme && mount -t ext4 /dev/nvme0n1 /nvme
elif [[ $num_nvme -gt 1 ]]; then
dev_name=`nvme list | grep -i /dev | awk '{print $1}'`
mdadm --create --verbose /dev/md127 --level=0 --raid-devices=$num_nvme $dev_name
mkfs.ext4 /dev/md127
mkdir /raid0 && mount -t ext4 /dev/md127 /raid0
else
echo "no ephemeral drives detected"
fi
Verify
When a new instance is created, SSH into the VM and perform the below commands to verify disk attachment.
- lsblk
- df -h
This would show the ephemeral disks associated to the VM. If the issue persist perform the below:
confirm if the /raid0
directory exists and try remounting the file system with
# sudo mount -t ext4 /dev/md127 /raid0
Lastly, try df -h
to confirm the change.
If the issue persists, please contact Crusoe Support at support@crusoecloud.com and we will be happy to assist!
Additional Resources
Comments
0 comments
Please sign in to leave a comment.