Wednesday, February 25, 2026

Volumes and Snapshots

 

📦 EBS Volume = Hard Disk

  • It is like a physical hard drive

  • Attached to an EC2 instance

  • Stores running data

  • Must be in same Availability Zone

📸 Snapshot = Backup Photo

  • It is a backup copy of a volume

  • Stored in S3 (managed by AWS)

  • Regional resource

  • Used to create new volumes

👉 Volume = Active storage
👉 Snapshot = Backup copy of storage


🔥 2️⃣ Technical Explanation (Engineer Level)

🟢 EBS Volume

  • Block-level storage

  • Attached to EC2

  • AZ-scoped

  • Can be modified (increase size, change type)

  • Types: gp3, io2, st1, sc1

  • Can be encrypted using KMS

  • Used for:

    • OS disk

    • Database storage

    • Application storage


🟣 Snapshot

  • Point-in-time backup of EBS volume

  • Region-scoped

  • Incremental (only changed blocks stored)

  • Stored in S3 (but you don’t see the bucket)

  • Used for:

    • Backup

    • Disaster Recovery

    • AMI creation

    • Cross-region migration


🟡 3️⃣ Direct Comparison Table (Important for Interview)

FeatureEBS VolumeSnapshot
TypeBlock StorageBackup of block storage
ScopeAZ-levelRegion-level
Attached to EC2?YesNo
Used directly by app?YesNo
Incremental?NoYes
Can modify size?YesNo
Used for DR?NoYes
Stored in S3?No (physically on EBS infra)Yes (internally by AWS)
Can create AMI?NoYes

🔴 4️⃣ VERY IMPORTANT Interview Points

These are the points that make you stand out.


🔥 Point 1: Volume is AZ-bound

You CANNOT:

  • Attach a volume to EC2 in another AZ

  • Move volume directly to another AZ

Solution:
Volume → Snapshot → Create new volume in target AZ


🔥 Point 2: Snapshot is Region-bound

You CANNOT:

  • Use snapshot in another region directly

Solution:
Copy snapshot to target region


🔥 Point 3: Snapshots are Incremental

If:

  • Volume = 100 GB

  • You change only 5 GB

Snapshot stores only changed blocks.

This reduces cost.


🔥 Point 4: Deleting Snapshot Does NOT Always Delete Data

Because:
Snapshots share blocks internally.

AWS keeps data blocks until no snapshot references them.


🔥 Point 5: Multi-Attach Confusion

Normal volumes:

  • Attached to one EC2 only

Exception:

  • io1/io2 support Multi-Attach

  • Requires cluster-aware filesystem


🔥 Point 6: Encryption Rules

If:
Volume encrypted → snapshot encrypted
Snapshot encrypted → new volume encrypted

Cross-account requires KMS permissions.


🔥 Point 7: Performance Difference

Volume performance depends on:

  • Type (gp3 vs io2)

  • IOPS

  • Throughput

Snapshot performance:

  • First read after restore may be slower

  • Use Fast Snapshot Restore (FSR) for high performance


🟣 5️⃣ Real-World Scenarios (Interview Style)

Q: How do you migrate EC2 data from AZ-a to AZ-b?

Answer:

  1. Create snapshot

  2. Create volume in target AZ

  3. Attach to EC2

  4. Mount


Q: How do you implement DR across regions?

Answer:

  1. Snapshot

  2. Copy snapshot to DR region

  3. Create volume

  4. Launch EC2

  5. Attach volume


Q: How to automate backups?

Answer:
Use:

  • AWS Data Lifecycle Manager (DLM)

  • AWS Backup


🧠 6️⃣ Advanced Concepts (For Senior Roles)

You can mention:

  • Fast Snapshot Restore

  • EBS Elastic Volumes

  • KMS encryption rotation

  • Snapshot sharing cross-account

  • AMI creation from snapshot

  • Root volume vs data volume differences

  • Consistency:

    • Use fsfreeze

    • Application-aware backups for DB


🎯 7️⃣ Interview Ready 5-Line Answer

If interviewer asks:

“Difference between EBS volume and snapshot?”

You say:

“EBS volume is AZ-scoped block storage attached to EC2 instances, used for live workloads. Snapshot is a region-scoped incremental backup of an EBS volume stored in S3. Volumes are used for active data storage, while snapshots are used for backup, disaster recovery, migration, and AMI creation. Volumes cannot move across AZs directly, but snapshots allow creating new volumes in any AZ within the region or across regions via copy.”

That’s a professional answer.


⚡ 8️⃣ Common Interview Trap Question

❓ Can I attach one EBS volume to multiple EC2s?

Correct Answer:

  • Normally NO

  • Only io1/io2 support Multi-Attach

  • Requires cluster-aware filesystem


30 Important Points – EBS Volume vs Snapshot (Full Summary)


🔵 Core Differences

1️⃣ EBS Volume = Block storage device attached to EC2

Snapshot = Point-in-time backup of an EBS volume


2️⃣ Volume is AZ-scoped

Snapshot is Region-scoped


3️⃣ Volume is used for live workloads

Snapshot is used for backup & recovery


4️⃣ Volume must be attached to an EC2 instance

Snapshot cannot be attached directly


5️⃣ Volume stores active data

Snapshot stores backup data


6️⃣ Volume changes in real time

Snapshot captures a specific moment


7️⃣ Volume is not incremental

Snapshot is incremental (block-level)


8️⃣ Volume performance depends on type (gp3, io2, etc.)

Snapshot performance depends on restore process


9️⃣ Volume exists inside one AZ only

Snapshot can create volumes in any AZ within region


🔟 Volume cannot move across AZ directly

Snapshot enables AZ migration


🟢 Storage & Architecture Points

11️⃣ Volume is physically backed by EBS infrastructure

Snapshot is stored internally in Amazon S3


12️⃣ Volume size can be modified (Elastic Volumes)

Snapshot size cannot be modified


13️⃣ Volume types affect IOPS & throughput

Snapshot has no IOPS concept


14️⃣ Volume supports file systems (ext4, xfs, NTFS)

Snapshot stores raw block data


15️⃣ Volume deletion removes storage immediately

Snapshot deletion is dependency-aware (shared blocks)


🟣 Backup & DR Concepts

16️⃣ Volume is not a backup

Snapshot is backup mechanism


17️⃣ Snapshot supports cross-region copy

Volume does not support cross-region move


18️⃣ Snapshot enables disaster recovery

Volume alone cannot provide DR


19️⃣ Snapshot can create AMIs

Volume cannot directly create AMI


20️⃣ Snapshot can be shared cross-account

Volume cannot be shared across accounts


🟡 Security & Encryption

21️⃣ Volume encryption uses KMS

Snapshot inherits encryption


22️⃣ Encrypted volume → encrypted snapshot

Encrypted snapshot → encrypted volume


23️⃣ Cross-account snapshot sharing requires KMS permissions

Volume sharing does not exist


🔴 Performance & Optimization

24️⃣ First read after restoring from snapshot may be slower

Fast Snapshot Restore (FSR) improves this


25️⃣ Volume performance can be provisioned (IOPS)

Snapshot has no provisioned performance


26️⃣ Volume scaling is online (increase only)

Snapshot cannot scale


🟠 Multi-Attach & Advanced

27️⃣ Volume usually attaches to one EC2 only

Only io1/io2 support Multi-Attach


28️⃣ Snapshot is dependency-based incremental chain

Deleting one snapshot may not free all storage


29️⃣ Snapshot creation can be crash-consistent

For app-consistency use fsfreeze / DB flush


30️⃣ Volume is operational storage

Snapshot is lifecycle/backup storage


🎯 Ultra-Short Interview Summary (Power Statement)

If interviewer asks for summary, say:

“EBS volume is AZ-scoped block storage attached to EC2 for live workloads, while a snapshot is a region-scoped incremental backup stored in S3, used for disaster recovery, migration, and AMI creation. Volumes cannot move across AZs, but snapshots enable cross-AZ and cross-region restoration.”


Configuring Java and Maven

  1️⃣ Configure Java Environment Open the Java environment file. sudo vi /etc/profile.d/java.sh Add these lines inside the file: expor...