Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)

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.

ubuntu@ip-xx-xx-xx-xx:~$ 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.

1 Answer

0 votes
by (18.2k points)

When you attach your volume to an instance, AWS provides a message saying:

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.

As shown in the screenshot below:

image

This isn't really a bug. You can run the following command on your putty terminal to see the volume name of the EBS volume that you attached to your instance:

lsblk

it will display something as follows:

image

Where /dev/xvdf is my volume, which, as per the first screenshot, started as /dev/sda

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories

...