Interview focused on EBS and AWS storage solutions
These questions and answers will prepare you well for an interview focused on EBS and AWS storage solutions. Let me know if you'd like additional scenarios or hands-on examples!
General Questions
What is Amazon EBS, and how does it work?
- Answer:
Amazon Elastic Block Store (EBS) is a high-performance block storage service designed for use with Amazon EC2 instances. EBS volumes are network-attached and remain independent of the lifecycle of the instance. It provides persistent storage for applications, and you can attach multiple EBS volumes to an EC2 instance.
- Answer:
What are the different types of EBS volumes?
Answer:
The main types of EBS volumes are:General Purpose SSD: gp2, gp3
Provisioned IOPS SSD: io1, io2
HDD: st1 (Throughput-Optimized HDD), sc1 (Cold HDD)
Magnetic: Standard (legacy).
What is the difference between gp2 and gp3?
Answer:
gp2: Performance scales with volume size (3 IOPS/GB), up to 16,000 IOPS and 250 MB/s.
gp3: Fixed baseline performance of 3,000 IOPS and 125 MB/s, configurable up to 16,000 IOPS and 1,000 MB/s independently of size.
gp3 is more cost-effective and flexible compared to gp2.
Which EBS volume type is best suited for high IOPS requirements?
Answer:
For high IOPS, use io1 or io2.
io1 supports up to 64,000 IOPS.
io2 offers the same IOPS but with better durability (99.999%).
What is the difference between io1 and io2?
Answer:
Both provide high IOPS and low latency for critical workloads.
io2 has higher durability (99.999%) compared to io1 (99.9%).
io2 is ideal for enterprise applications requiring enhanced reliability.
Performance and Cost
When would you use st1 over sc1?
Answer:
Use st1 for workloads that require high throughput, such as streaming big data, data warehouses, and log processing.
Use sc1 for infrequently accessed cold data storage (e.g., backups and archives).
How do you decide between SSD and HDD volumes?
Answer:
Choose SSD volumes (gp2, gp3, io1, io2) for low-latency, high-performance workloads like transactional databases or boot volumes.
Choose HDD volumes (st1, sc1) for sequential workloads or where cost is a priority.
What are the cost-saving strategies for using EBS?
Answer:
Use gp3 instead of gp2 for better cost efficiency.
Archive cold data on sc1.
Take advantage of volume snapshots for backups instead of keeping extra volumes.
Technical Operations
How can you check the file system of an attached EBS volume?
Answer:
Use the command:sudo file -s /dev/xvdf
It will display the file system type or indicate if the volume is unformatted.
How do you format and mount an EBS volume?
Answer:
Format the volume:
sudo mkfs.ext4 /dev/xvdf
Create a mount point:
sudo mkdir /data
Mount the volume:
sudo mount /dev/xvdf /data
How do you resize an EBS volume without downtime?
Answer:
Modify the volume size in the AWS Console or CLI:
aws ec2 modify-volume --volume-id vol-xxxx --size 100
Extend the partition using:
sudo growpart /dev/xvdf 1
Resize the file system:
sudo resize2fs /dev/xvdf
How do you ensure an EBS volume is automatically mounted after reboot?
Answer:
Add an entry in/etc/fstab
. Example:UUID=<your-uuid> /data ext4 defaults,nofail 0 2
Monitoring and Troubleshooting
How do you monitor the performance of an EBS volume?
Answer:
Use Amazon CloudWatch metrics such as:VolumeReadOps and VolumeWriteOps: Total read/write operations.
VolumeReadBytes and VolumeWriteBytes: Bytes read/written.
VolumeQueueLength: Number of operations in the queue.
BurstBalance: Indicates remaining burst credits for gp2/sc1 volumes.
What happens if you detach an EBS volume without unmounting it?
Answer:
Data corruption can occur. Always unmount the volume before detaching:sudo umount /data
Advanced Questions
Can you attach an EBS volume to multiple instances?
Answer:
Yes, but only with the EBS Multi-Attach feature, supported on io1 and io2 volumes.
This is useful for clustered applications requiring shared storage.
What is the maximum size of an EBS volume?
- Answer:
The maximum size is 16 TiB.
- Answer:
How do you convert a gp2 volume to gp3?
Answer:
Use the AWS CLI to modify the volume:aws ec2 modify-volume --volume-id vol-xxxx --volume-type gp3
What is the relationship between IOPS and throughput in EBS volumes?
Answer:
IOPS (Input/Output Operations per Second): Measures the speed of small, random operations.
Throughput: Measures the speed of large, sequential operations in MB/s.
SSD types optimize IOPS, while HDD types optimize throughput.
Explain how EBS snapshots work and their use cases.
Answer:
EBS snapshots are point-in-time backups of an EBS volume, stored in Amazon S3. Snapshots are incremental, meaning only changes since the last snapshot are saved, which optimizes storage costs.
Use cases include:Creating backups for disaster recovery.
Migrating data between regions or accounts.
Creating new volumes from existing data.
What are the limitations of EBS multi-attach, and how does it work?
Answer:
Multi-Attach allows a single EBS volume to be attached to multiple EC2 instances in the same AZ.
Limitations:
Only supported on io1 and io2 volumes.
File systems must support shared access (e.g., clustered file systems like Lustre or GFS).
Concurrent writes need to be managed at the application level to avoid data corruption.
What are EBS burst credits, and how do they impact gp2/sc1 performance?
Answer:
Burst credits allow EBS volumes to temporarily exceed their baseline performance.gp2: Accumulates burst credits when idle, enabling short-term IOPS up to 3,000.
sc1: Uses credits for throughput up to 80 MB/s.
Monitoring Burst Balance via CloudWatch is crucial to avoid performance degradation.
How do you encrypt an unencrypted EBS volume?
Answer:
Direct encryption of an unencrypted EBS volume isn’t possible. Instead:Create a snapshot of the unencrypted volume.
Copy the snapshot with encryption enabled.
Create a new encrypted volume from the copied snapshot.
Attach the new volume to the instance.