How to reliably list ephemeral storage of an AWS instance?
I don't have the setup to check if this this specific to Amazon Linux AMIs, but on my setup here, /dev/sdX
is symlinked to the corresponding /dev/xvdX
device.
curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral0 --> sdb
[ec2-user@ip-172-31-61-112 ~]$ ls -lrt /dev/sd*
lrwxrwxrwx 1 root root 4 Jun 24 01:06 /dev/sdb -> xvdb
lrwxrwxrwx 1 root root 4 Jun 24 01:07 /dev/sda -> xvda
lrwxrwxrwx 1 root root 5 Jun 24 01:07 /dev/sda1 -> xvda1
lrwxrwxrwx 1 root root 4 Jun 24 02:09 /dev/sdf -> xvdf
[ec2-user@ip-172-31-61-112 ~]$ 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 30G 0 disk [SWAP]