Chapter 13: Amazon EBS (Elastic Block Store)
Practice Questions and Lab Exercises
- What is EBS? How is it different from instance store?
- Compare gp3, gp2, io2, st1 and sc1 volume types with one use case each. Which cannot be used as boot volumes?
- What is an incremental snapshot? How do you move an EBS volume to another AZ?
- Why do device names differ between the console (
/dev/sdf) and Linux (/dev/nvme1n1)? - List the commands to grow an XFS root volume and an ext4 root volume after modifying the size.
- Why do we use UUID and
nofailin/etc/fstab? How do you test fstab before rebooting? - Lab: Increase your root volume from 8 GiB to 12 GiB on a running Amazon Linux 2023 instance and verify with
df -hT. - Lab: Repeat on Ubuntu (ext4) using
resize2fs. - Lab: Create a 5 GiB gp3 volume, attach, format as XFS, mount at
/datawith a permanent fstab entry, reboot and verify. - Lab: Take a snapshot of the data volume, create a new volume from it in another AZ, attach it to another instance and read your file (do not run
mkfs!). - Lab: Detach the volume safely and delete it.
Quick Revision
- EBS = persistent network block storage in one AZ; snapshots are regional & incremental.
- Types: gp3 (default SSD, 3,000 IOPS baseline), gp2 (older, size-based IOPS), io2 (provisioned high IOPS), st1 (throughput HDD), sc1 (cold HDD).
- Nitro:
/dev/sdfappears as/dev/nvme1n1; use UUIDs. - Grow: console Modify volume →
growpart /dev/nvme0n1 1→xfs_growfs -d /(XFS) orresize2fs /dev/nvme0n1p1(ext4) →df -hT. - Add: create in same AZ → attach →
lsblk→file -s→mkfs→mkdir→mount→ fstabUUID=... /data xfs defaults,nofail 0 2→mount -a. - Detach: stop users →
umount→ remove fstab line → detach in console.