When you attach an EBS volume, you specify the device to attach it as. Under linux, these devices are
/dev/xvd* - and are symlinked to
In the AWS console, you can see your EBS volumes, what instances they are attached to, and the device each volume is attached as:
You can achieve the same thing from the CLI tools.
Set the necessary environment variables:
Run the command on your current instance (otherwise, just specify the instance-id):
ec2-describe-instances `curl -s http://169.254.169.254/latest/meta-data/instance-id` | grep BLOCKDEVICE
BLOCKDEVICE /dev/sda1 vol-xxxxxxxx 2011-11-13T21:09:53.000Z
BLOCKDEVICE /dev/sdf vol-xxxxxxxx 2011-11-13T21:09:53.000Z
BLOCKDEVICE /dev/sdg vol-xxxxxxxx 2011-11-13T21:09:53.000Z
It is worth noting that in both cases above - the CLI and the AWS Console - the devices are described as being attached at
/dev/sd* - this is not actually the case, however.
Look at the contents of /dev:
ls -l /dev/sd* /dev/xv*
lrwxrwxrwx 1 root root 5 Dec 12 18:32 /dev/sda1 -> xvda1
lrwxrwxrwx 1 root root 4 Dec 12 18:32 /dev/sdf -> xvdf
lrwxrwxrwx 1 root root 4 Dec 12 18:32 /dev/sdg -> xvdg
brw-rw---- 1 root disk 202, 1 Dec 12 18:32 /dev/xvda1
brw-rw---- 1 root disk 202, 80 Dec 12 18:32 /dev/xvdf
brw-rw---- 1 root disk 202, 96 Dec 12 18:32 /dev/xvdg
The devices are actually
/dev/xvd* - and the
/dev/sd* paths are symlinks.
Another approach to check for the currently available devices is to use
fdisk -l, or for a simpler output:
major minor #blocks name
202 1 4194304 xvda1
202 80 6291456 xvdf
202 96 1048576 xvdg
If you need to determine which devices have been mounted use
df - and check
/etc/fstab to change the mount options.