- Newest
- Most votes
- Most comments
Here is a command you can run to show this information. Replace $INSTANCE_ID
below with your instance ID.
aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$INSTANCE_ID --query '[Volumes[*].VolumeId,Volumes[*].Attachments[0].InstanceId,Volumes[*].Attachments[0].Device,Volumes[*].VolumeType]' --output text
Each volume attached to the instance will be in a separate column. The row values are the volume ID, instance ID, device attachment, and volume type. For example:
vol-xxxxxxxxxxx vol-zzzzzzzzz
i-yyyyyyyyy i-yyyyyyyyy
/dev/xvda /dev/sdf
gp2 gp3
Hi, good question. You can do this on the new AWS Management console by viewing volumes, where this will list information such as size, volume type, whether the volume is encrypted, which KMS key was used to encrypt the volume, and the specific instance to which it is attached.
Via CLI: describe-volumes
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-describing-volumes.html
I switched to the new console but, somehow, when I click on the volume, the page goes blank (not sure why). I'll try with a different instance later. (I'm trying not to use the CLI for reasons that would take me a while to explain)
To look it up by volume device name (/dev/nvme1n1 in my example), use the following command:
lsblk -P -o SERIAL /dev/nvme1n1 |cut -d "\"" -f 2 | sed "s/vol/vol-/" | xargs aws ec2 describe-volumes --volume-ids --query "Volumes[*].VolumeType" --output text
The command will return the volume type:
gp3
It worked. Thanks.
Relevant content
- Accepted Answerasked a year ago
- Accepted Answerasked 4 years ago
- asked 8 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 months ago
It worked. Thanks.