How to Create and Mount an EBS to an EC2 Instance:

aws-logoAmazon EBS (Elastic Block Storage) is only designed for Amazon EC2 instance. It allows us to create volumes and mount it to the instance. EBS are behaving like raw unformatted external drives. You can attach them with your supplied name. You can create file systems using the EBS. In this article I will show you how to create, attache and delete a EBS using command line.

To Create an EBS volume use the below command:

To get information about the volume (Please modify the volume ID)

To attache the volume with an Instance (Please modify the instance ID)

After attaching the volume to an Instance we need to SSH to the instance to create a file system. SSH to your instance and issue the below command.

Now you have a new file system mounted to the folder /mnt/data-store

To unmount the file system.

To detach the volume

To delete the volumen

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply