How to mount Amazon EC2 EBS volume on an instance’s file system

The following assumes you have created a volume in AWS Management Console and attached it to your instance as /dev/sdh.
 
A brand new volume is unformatted block storage.  It shows up as another device, but doesn’t contain a filesystem.  (An EBS volume that previously had a filesystem created on it won’t be mounted either by the attachment process).
 
You can verify that your instance can see the EBS volume by running the following command on the instance:
 
cat /proc/partitions
 
You’ll see an entry for sdh.  At this point, you should create a filesystem and mount it manually.  You could create an EXT3 filesystem on the device and then mount it on ‘/mnt/ebs’ with the following commands, (run as root):
 
mke2fs -F -j /dev/sdh
mkdir /mnt/ebs

mount /dev/sdh /mnt/ebs 

5 thoughts on “How to mount Amazon EC2 EBS volume on an instance’s file system”

  1. To get the mount to be available on reboot, the fstab has to be modified.

    sudo nano /etc/fstab

    add line:
    /dev/sdh /mnt/ebs ext3 defaults 0 0

  2. note: on some versions of Ubuntu, the path is renamed from /dev/sdh -> /dev/xvdf

    Amazon EC2 warns about this, when you attach the volume to the instance.

Leave a Reply

Your email address will not be published. Required fields are marked *