Let’s start by Understanding the Basic of EBS volume and then we will see how to take a backup of EBS volume of Running EC2 Instance.

What is EBS?

EBS also known as Elastic Block Storage is a persistent (permanent) storage device used to store the information / data of users , applications and operating systems.

It is a block level storage and we can use it with EC2 Instances.Like an external device , You can attach / mount multiple EBS volumes to an Running EC2 Instances.

You can configure the filesystems and configurations of the EBS volume as per your requirement.

If you would like to know , How to Resize EBS Volume without Rebooting Instance <– Check here.

Types of EBS Volume

Amazon EBS has 4 types of Volume, Each volume type has difference in performance and use cases.

  • General pupose SSD (GP2)
  • Provisioned IOPS SSD (io1)
  • Cold HDD (sc1)
  • Throughput optimized HDD (st1)

Creating backup of EBS Volume

Backup of data stored in EBS Volume is referred as Snapshots.You can create a point-in-time snapshots which will be stored in S3 Bucket.

You can also create incremental backup of EBS Volume which will take a backup of recent changes to the snapshots and also it reduces the time of backup.

If your EBS volume is encrypted, The Snapshot of that volume will also be encrypted.

To create snapshot of EBS Volume , Login to EC2 CONSOLE

Select Instances in the Left navigation pane,

In the lists of Instances , Select the instance and Under Description

You can find the volume attach with your EC2 Instance.

EBS volume

Click Block devices , You will see EBS ID which is the Volume Id , Select it,

It will take you to the Volumes page of the EC2 management Console.

Select the Volume and Under Actions,

Choose Create Snapshot , Provide a description and Add a Tag If required.

And click Create Snapshot.

You will get a Snapshot id , Clicking that Will take you to the Snapshots page.

EBS volume

Depending on the size of the EBS Volume , The Snapshot creation will take time.

You can check the Progress of the Snapshot creation . Once the snapshot is created , The Status of snapshot will change from Pending to Completed.

We have created snapshot of EBS Volume. In other words , The data stored in the EBS Volume is backed up.

Creating snapshot using AWS CLI

If you’re not aware of AWS CLI , It’s a command line utility to Create and manage AWS resources. Check out my detailed article on How to Configure AWS CLI

Once you have configured AWS CLI on Ubuntu, Lets go ahead and create snapshot of EBS volume using AWS CLI.

First, We need the Volume ID of EBS Volume , To know that , Select the EC2 Instance , Under Description , Click Block devices.

You will get EBS ID which is also known as Volume ID ,It will be something like this : vol-0hd589fb29h5c7dd.

Now We’re going to create a snapshot of that Volume ID using the below command.

aws ec2 create-snapshot --volume-id vol-08g79fb29h5c7dd --description "Create snapshot of EBS Volume"

You will get the response as shown below:

{
    "Description": "Create snapshot of EBS VOlume",
    "Encrypted": false,
    "OwnerId": "410374650795",
    "Progress": "",
    "SnapshotId": "snap-0f17f41n8sj5f8eb5",
    "StartTime": "2020-02-17T17:05:06.000Z",
    "State": "pending",
    "VolumeId": "vol-01ba1n7dl633db6dd",
    "VolumeSize": 50,
    "Tags": []
}

You can check the progress of Snapshot creation , By copying the snapshot from the above response,

Go to EC2 Console , Select Snapshots in the left navigation pane.

Paste the snapshot id , You can check the status here.

Conclusion

We have learnt to backup the data stored on the EBS Volume using Console and Also We have created snapshot of the EBS volume using command line interface , AWS CLI.

Hope you found it helpful.Thanks for reading this article.

Kindly Check out my other publications.