Wondering how to identify instance store volumes in EC2? We can help you!
Often customers with Amazon EC2 Linux instance with both Amazon Elastic Block Store volumes and instance store (ephemeral) volumes, ask us how to identify instance store volumes in EC2.
Here at Bobcares, we handle requests from our customers regarding similar issues as a part of our Server Management Services.
Today let’s see how our Support Engineers do this for our customers with EC2 instances.
How to Identify instance store volumes in EC2
For identifying instance store volumes on Amazon EC2 Linux instances, we must first check if the instance type supports instance store volumes. And if it supports we can check the type of instance store volumes that are supported. Then review the volume’s information from the operating system (OS).
Steps to identify:
1 .We must verify what type of instance store volume (HDD, SSD, or NVMe SSD), if any, that our instance supports.
2. The identification method that is used depends on whether we have NVMe SSD or HDD/SSD instance store volumes.
NVMe SSD instance store volumes
Following are the steps for NVMe SSD volumes:
1. Firstly, we must connect to our instance.
2. Then we must install the NVMe command line package, nvme-cli, using the package management tools for our Linux distribution.
3. And run the following nvme list command as a privileged user.
$ sudo nvme list
The following is a sample output from an instance type that supports one NVMe SSD device:
$ sudo nvme list
Node SN Model Namespace Usage Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 vol0923757ba05df9515 Amazon Elastic Block Store 1 0.00 B / 8.59 GB 512 B + 0 B 1.0
/dev/nvme1n1 AWS1A4FC25FB16B79F76 Amazon EC2 NVMe Instance Storage 1 50.00 GB / 50.00 GB 512 B + 0 B 0
HDD or SSD instance store volumes
For HDD or SSD instance store volumes, we can get the list of attached block devices from the OS. Then retrieve the block device mapping section that is contained in the instance metadata.
1. Firstly, we must connect to our instance.
2. Then run the following lsblk command:
$ sudo lsblk
The following is a sample output that shows the list of block devices that are retrieved from an instance which supports SSD instance store volumes.
$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdb 202:16 0 745.2G 0 disk
xvdc 202:32 0 745.2G 0 disk
xvdd 202:48 0 745.2G 0 disk
xvde 202:64 0 745.2G 0 disk
3. To identify if xvdb, is an ephemeral drive and retrieve the block-device-mapping metadata:
$ curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral0 sdb $ ls -l /dev/sdb lrwxrwxrwx 1 root root 4 Aug 27 13:07 /dev/sdb -> xvdb
[Need assistance? We can help you]
Conclusion
To conclude, we saw the steps that our Support Techs follow to identify instance store volumes in EC2.
0 Comments