How to attach new EBS volume to Ubuntu machine on AWS?

Disclaimer: I'm probably missing something obvious, sorry in advance.

I need more EBS disk space for my Ubuntu 11.04 server running on Amazon EC2, and decided to create new volume in addition to the root volume. (It's an EBS-backed instance, created from official Ubuntu AMIs.)

So, I opened AWS management console, created a volume, and attached it to the instance:

enter image description here

I chose /dev/sdb as suggested by the dialog. AWS console shows the volume as correctly attached to the instance.

Problem is, the device /dev/sdb is not available on the instance, not immediately nor after reboot:

$ sudo mkfs.ext4 /dev/sdb
mke2fs 1.41.14 (22-Dec-2010)
Could not stat /dev/sdb --- No such file or directory

Did I miss some necessary step, or is the volume available under some other device name?

(Also tried /dev/sdc with same result; /dev/xvda3 wasn't accepted as "valid EBS device name".)


Solution 1:

The devices are named /dev/xvdX rather than sdX in 11.04. This was a kernel change. The kernel name for xen block devices is 'xvd'. Previously Ubuntu carried a patch to rename those devices as sdX. That patch became problematic.

You could, if you really wanted, run your own kernel with a patch applied. bug 684875 has more information on why this was changed.

So, to answer your question, attach it /dev/sdb, it will appear as /dev/xvdb.