Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created an EC2 instance, created an EBS volume, attached it to the running instance, and successfully ssh'ed into my instance.

The drive is attached as /dev/sdf

Next, I tried mounting the drive by running:

mkdir /testName
mount -t ext3 /dev/sdf /testName

But then I get the error message:

mount: wrong fs type, bad option, bad superblock on /dev/sdf,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

What am I doing wrong?

Thanks.

share|improve this question
    
Did you try running "dmesg | tail" to see the error message ? – Shyam Sundar C S Mar 9 '12 at 18:32

In fact unless it is a snapshot, as an uninitialised block device, you may need to..

  • Create a partition table
  • Label the volume
  • Create partitions (at least 1)
  • Create a file system on your partition
  • Format the file system if required

None of these are strictly necessary if you do not want a filesystem, if you are only storing one file or stream (tar or dd style).

These options provide us with a great deal of control, and are the same tasks one would perform when installing a "clean" drive on your own metal.

share|improve this answer

Here's a complete set of commands that you should run once you've attached the EBS volume to your EC2 instance:

mkfs -t ext3 /dev/sdf   # (NOTE - if you created your EBS volume from a snapshot of another volume and want to preserve its data, skip this step)
echo "/dev/sdf  /testName  ext3     noatime  0 0" >> /etc/fstab
mkdir /testName
mount /testName
df -h                   # (you should now see a new /testName file system mounted on the EBS volume)
share|improve this answer

I had the same problem while mounting an EBS volume that I had taken a snapshot of. The gotcha was that when I attached the volume (e.g., /dev/sdf), it was actually partitioned so (/dev/sdf1) was also created. I was able to mount /dev/sdf1 with no problem.

share|improve this answer
    
This was the answer. – Shatiz Oct 25 '15 at 12:10

Have you created the filesystem yet?

mkfs -t ext3 /dev/sdf
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.