Created
February 23, 2021 23:16
-
-
Save charlieoleary/b17b4cff4baa1085642d9eaa97ee5216 to your computer and use it in GitHub Desktop.
Get EC2 Instance Storage Devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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