Skip to content

Instantly share code, notes, and snippets.

@charlieoleary
Created February 23, 2021 23:16
Show Gist options
  • Save charlieoleary/b17b4cff4baa1085642d9eaa97ee5216 to your computer and use it in GitHub Desktop.
Save charlieoleary/b17b4cff4baa1085642d9eaa97ee5216 to your computer and use it in GitHub Desktop.
Get EC2 Instance Storage Devices
cat /dev/null > ${HOME}/instance_storage_devices
for device in $(ls -1 /dev/nvme*n[0-1000]); do
MNT_TYPE=$(nvme id-ctrl -v $device | grep mn | grep -v mntmt | cut -d":" -f2);
[[ "${MNT_TYPE}" == *"NVMe Instance Storage"* ]] && echo -n " ${device}" >> ${HOME}/instance_storage_devices
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment