# Amazon EBS

> The virtual hard drive of an EC2 instance, kept alive even when the instance stops.

- Level: Intermediate
- Topics: AWS
- URL: https://tidbit.legios.com.ar/amazon-ebs/
- In Spanish: [Amazon EBS](https://tidbit.legios.com.ar/es/amazon-ebs/)

**EBS** (Elastic Block Store) provides **volumes**: virtual disks that you attach to an Amazon EC2 instance and that the operating system sees as a normal drive. The instance's root disk is an EBS volume; you can add more, like plugging in extra hard drives, and each one can be resized while in use.

The key property is that a volume is independent from the instance. Stop or terminate the machine and the volume can stay, be attached to a different instance in the same Availability Zone, or be captured as a **snapshot**: a backup stored in Amazon S3 that you can turn into a new volume anywhere in the Region, or copy to another one. AWS replicates every volume inside its zone, so one failed disk does not lose data.

Volume types trade price for speed: `gp3` (general purpose SSD) is the default for almost everything, `io2` offers guaranteed high performance for demanding databases, `st1` and `sc1` are cheap spinning disks for large sequential files. You pay per gigabyte provisioned per month, used or not, plus the snapshots. EBS is block storage attached to one machine; for files shared by many or served to the web, Amazon S3 is the tool.

## An analogy

An external hard drive. You plug it into one laptop, unplug it, plug it into another, and keep a copy in a safe (the snapshot). It is still a drive: one computer at a time, and it has to be in the same room (the zone).

## Keep in mind

- A volume lives in one Availability Zone and attaches to one instance at a time.
- Snapshots are incremental backups stored in S3; copy them across Regions for disaster recovery.
- `gp3` is the default; pick `io2` for heavy databases, `st1` or `sc1` for cheap bulk storage.
- You pay for the gigabytes you provision, not for the ones you fill.

## Go deeper

- [What is Amazon EBS? (official docs)](https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html)
- [Amazon EBS](https://aws.amazon.com/ebs/)

## Related terms

- [Amazon EC2](https://tidbit.legios.com.ar/amazon-ec2/): Virtual computers you rent by the hour, in any size, and switch off when done.
- [Operating system](https://tidbit.legios.com.ar/operating-system/): The base software that runs a device and lets every app share its hardware.
- [Hard disk drive](https://tidbit.legios.com.ar/hard-disk-drive/): Storage that keeps data on spinning magnetic platters: slower than an SSD, but cheap.
- [Regions and Availability Zones](https://tidbit.legios.com.ar/regions-and-availability-zones/): Where AWS physically lives: cities worldwide, each split into separate data centers.
- [Backup](https://tidbit.legios.com.ar/backup/): A separate copy of your data, kept so you can get it back when the original is lost.
- [Amazon S3](https://tidbit.legios.com.ar/amazon-s3/): A giant online drawer for files, rented by the gigabyte.
- [SSD](https://tidbit.legios.com.ar/ssd/): Storage with no moving parts: where your files live when the power is off.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
