EC2: EBS device id confusion (/dev/sdf vs. /dev/xvdf)

I attached an EBS volume to my EC2 instance, turned it into a EXT3 file system, and successfully mounted it. However, I was thrown off a little bit initially mainly due to what the AWS console said my EBS device ID was.

According to the AWS console:

i-xxxxxxx :/dev/sdf (attached)

I took this to mean that my attached EBS device id was /dev/sdf. So when I attempted to turn the device into a file system using this device id, I received the following error message.

[email protected]:~$ mkfs -t ext3 /dev/sdf
mke2fs 1.42 (29-Nov-2011)
Could not stat /dev/sdf --- No such file or directory
The device apparently does not exist; did you specify it correctly?

Then after researching a little bit, I found this article and then subsequently found out by running cat /proc/partitions that my true device id was /dev/xvdf not /dev/sdf.

My question is why is the AWS console saying it’s /dev/sdf when it’s actually /dev/xvdf? I think there has to be some kind of logical explanation for this.

How to seed the root device of an EBS backed EC2 instance from snapshot?

As I understood, for an EBS backed EC2 instance, it’s root device will be an EBS volume. Now if I want to have the content of the EBS volume to be a snapshot that I took earlier (for the root device o

Amazon EC2 – Swap root instance store device with EBS device

I have an EC2 instance with instance store device as a root device. Now, I would like to attach an EBS volume to that same instance, only that I want it to be the root device. Is that possible? What

Attaching ec2 with ebs volume

Here is my code for attachment of EC2 with EBS volume. private static AttachVolumeResult attachEBSVolume(String volumeId, String instanceId, String device){ AttachVolumeRequest attachVolReq = new Att

Can I change the root EBS device of my amazon EC2 instance?

I have an EBS backed Amazon EC2 instance. I’d like to change the root device on this instance. Can you please advise the best way to go about this? I only find documentation on changing several attri

Should I detach EBS Volume in Root Device after attaching new EBS Volume in Amazon EC2 Instance?

My Amazon EC2 Instance only have 8GB of EBS Volume sda1, this volume is near to full capacity. Then I attach new 21GB EBS Volume sdf to this EC2 Instance. When I use df -h to check this usage, this is

Mongodb EC2 EBS Backups

I have confusion on what I need to do here. I am new to Mongo. I have set up a small Mongo server on Amazon EC2, with EBS volumes, one for data, one for logs. I need to do a backup. It’s okay to take

PostgreSQL performance on EC2/EBS

What gives best performance for running PostgreSQL on EC2? EBS in RAID? PGData on /mnt? Do you have any preferences or experiences? Main plus for running PostgreSQL on EBS is switching from one to a

(AWS/EC2/EBS) Why does “Delete on Termination” default to true for root devices?

On Amazon EC2, when you use an EBS volume as the root device for an EC2 instance, the Delete on Termination flag defaults to true, meaning the volume will automatically be deleted when you destroy t

EBS snapshots vs. WAL-E for PostgreSQL on EC2

I’m getting ready to move our posgresql databases to EC2 but I’m a little unclear on the best backup and recovery strategy. The original plan was to build an EBS backed server, set up WAL-E to handle

Amazon EC2 – Convert EBS root device with instance store root device

I see that you can convert an instance stored instance to be EBS backed as this question shows. However, I want to do the opposite, take an EBS backed instance and convert it to be Instance Store back



This question had already been answered in Aug 24 ’12, but that answer with 6 upvotes got deleted in May 01 ’13 by the Community Moderator (i.e. a resp. automation process) for non transparent reasons (apparently because the User was removed) – anyway, I’m adding back a slight variation of the original content from my point of view.


AWS provides the following message/warning when attaching a volume via the AWS Management Console:

Note: Newer linux kernels may rename your devices to /dev/xvdf through /dev/xvdp internally, even when the device name entered here (and shown in the details) is /dev/sdf through /dev/sdp.

I don’t have any upstream source for this information handy, but Jay Rum’s answer to the (not longer relevant) temporary problem EBS Disks starting as device /dev/xvde, but mapped as /dev/sda attributes this functionality to the xen-blkfront driver:

The “xen-blkfront” driver, which allows the virtual machines (i.e. the EC2 instances) to access the underlying block devices, traditionally mapped sda, sdb… to xvda, xvdb…, […]

Finally, cyberx86′ answer to How do I access the attached volume in Amazon EC2 provides a detailed and illustrated explanation of this device naming mismatch and how to deal with it, i.e. identify the currently available devices etc.