EBS ~ Elastic Block Storage

EBS ~ Elastic Block Storage

AWS EBS easily explained.

·

4 min read

Elastic Block Storage (EBS)

EBS is nothing but virtual hard disk for our EC2 instance.

EBS provides 2 things :-

  1. EBS Volume :- It is the virtual Hard disk for our EC2 instances.
  2. EBS Snapshot :- EBS snapshot is used to take backup of EBS volume.
  • EBS is a block based storage like an hard disk
  • EBS is used to run an EC2 instance Operating System, like when we are launching an instance we see in the storage 8GB of volume that is actually the EBS volume we call it root volume which store our Operating System Data.
  • EBS can also be used to store other type of data like database, web-server file data etc.
  • while creating an EBS volume we specify an "Availability zone" and our EC2 instance must be in the same Availability zone.
  • EBS volume data will be automatically replicated within the availability zone to protect from upcoming failure on our EBS volume at the data center level. But this is within the same Availability zone not in multiple availability zone.

As we have different types of Hard disk for our computer just like that we have different types of EBS volume also.

EBS Volume types

  1. General purpose :- As the name says general purpose, it means it is mostly used for most of our workloads like if we want to run a web-server we will go for general purpose EBS.

    • This volume is SSD (Solid State Drive)
  2. Provisioned IOPS :- This volume type is mostly used for running large database where we need really very good performance for our databases.

    • IOPS volume speed is more than general purpose volume.
  3. Throughput Optimized HD :- This volume type is mostly used for big data and where houses stuff.

  4. Cold HDD :- Cold HDD type is generally used for file server. It is really very low cost volume type.

  5. Magnetic :- It is the slowest volume type and mostly used for backups and archives. It is also very very cheap volume type.

If we are not using any such large database and big data then General purpose recommend volume type to use. But obviously based on speed, cost and requirement we can select any other volume type.

Snapshot

EBS provide us a direct backup mechanism for EBS volume called Snapshot

  • It is mostly used to take backup of volume and restore it on the event of failure.

Steps to create snapshot from volume.

Step 1 :- Go to EBS resource in AWS and select volume option

Step 2 :- Select the volume for which we want to take snapshot.

Step 3 :- Go to action and choose option create Snapshot

Step 4 :- Give any description for snapshot if want and then click on create.

snapshot of volume is created. To check the status of snapshot if it is created or not --> Go to snapshot section of EBS.

Steps to create volume from snapshot.

Step 1 :- Go to snapshot section and select the snapshot for which we want to create volume.

Step 2 :- Go to action and select create volume.

Step 3 :- Change volume type, size, Availability zone etc if want.

Step 4 :- Click on Create Volume button

Steps to attach volume to ec2 instance created with Snapshot.

Step 1 :- Get inside EC2 instance terminal and unmount the volume/partition.

Step 2 :- Detach Volume from EC2 instance with help of AWS console.

Step 3 :- Create new Volume from snapshot.

Step 4 :- Attach newly created volume from snapshot to EC2 instance.

Step 5 :- Mount the volume back with help of EC2 terminal and commands.

Note :- Snapshot doesn't help in recovery of data or repairing the volume what it does is that it create the new volume with same data inside. And then we attach that new volume to our EC2 instance.

That's it This is the high level overview of EBS service in AWS.

Hope you Enjoyed and learn something from my blog.

Thank You for reading ☺☺

Did you find this article valuable?

Support Gautam Jha by becoming a sponsor. Any amount is appreciated!