Chapter 13: Amazon EBS (Elastic Block Store)
Hello friends! Sooner or later every server's disk fills up – and at the wrong time too. In this chapter we will learn to handle storage calmly: volume types, snapshots, growing a disk, adding a new disk and detaching safely. Example: on the server of a dairy brand like Amul (sample data, for practice) the orders data grows every day. Do every command with me, and think twice before running mkfs.
नमस्कार मित्रांनो! कधी ना कधी प्रत्येक सर्व्हरची डिस्क भरते – आणि ते पण चुकीच्या वेळी. या चॅप्टरमध्ये आपण स्टोरेज शांतपणे सांभाळायला शिकू: व्हॉल्यूम टाइप्स, स्नॅपशॉट्स, डिस्क वाढवणं, नवीन डिस्क जोडणं आणि सेफ डिटॅच. उदाहरण: Amul-style dairy (सॅम्पल डेटा, सरावासाठी) च्या सर्व्हरवर ऑर्डर्सचा डेटा रोज वाढतोय. प्रत्येक कमांड माझ्यासोबत करा, आणि mkfs चालवण्याआधी दोन वेळा विचार करा.
नमस्ते दोस्तों! कभी न कभी हर सर्वर की डिस्क भर जाती है – और वो भी गलत समय पर. इस चैप्टर में हम स्टोरेज को शांति से संभालना सीखेंगे: वॉल्यूम टाइप्स, स्नैपशॉट्स, डिस्क बढ़ाना, नई डिस्क जोड़ना और सेफ़ डिटैच. उदाहरण: Amul-style dairy (सैंपल डेटा, सिर्फ़ अभ्यास के लिए) के सर्वर पर ऑर्डर्स का डेटा रोज़ बढ़ रहा है. हर कमांड मेरे साथ करो, और mkfs चलाने से पहले दो बार सोचो.
What you will learn in this chapter
- What EBS is and why
- Volume types: gp3 to sc1
- Snapshots
- NVMe device names
- Growing a volume live
- Adding a new data disk
- fstab with UUID and nofail
- Detaching safely
Concepts in this chapter
- 13.1What and why
- 13.2EBS volume types
- 13.3Snapshots
- 13.4NVMe device naming (important!)
- 13.5Increasing the size of a volume (root or data)
- 13.6Adding a new EBS volume
- 13.7Detaching a volume safely
- 13.8EBS best practices
Review and practice
Extended teaching notes
Why this lesson matters
Cloud security is mostly IAM, network exposure, logging and secure defaults. The shared responsibility model means the provider patches the metal; you patch what you configure.
- No public databases or public admin panels.
- Roles / OIDC instead of long-lived access keys.
- CloudTrail / Activity Logs / Audit Logs on and retained.
- S3/Blob/GCS: Block Public Access; encrypt; least privilege.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.
Practice Tasks
Stockholm Games is a gaming business in Stockholm. Erik Lindqvist looks after its IT and cloud work. They count money in SEK and run their AWS resources in the eu-north-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.
0 / 12
Easy Check free disk space
Why: If a disk is 100% full, apps and databases stop working.
What to do: Show free and used space of all mounted disks in human-readable units.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Easy List the disks
Why: After you attach an EBS volume, lsblk shows its device name.
What to do: List all block devices (disks and partitions) on the server.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Easy Check a folder's size
Why: du tells you how much space a folder uses, in easy units with -h.
What to do: Show the total size of /var/www/sthlmgames as one line in human-readable units.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Easy Check memory
Why: If RAM is full the server slows down or kills apps.
What to do: Show used and free memory in human-readable units.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Easy Snapshot an EBS volume
Why: A snapshot is a point-in-time backup of one disk, kept in S3 by AWS.
What to do: Create a snapshot of volume vol-044c54d4e2fcfdeed with description "nightly sthlmgames".
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Attach a volume to an instance
Why: A volume must be attached (same AZ) before the server can see it.
What to do: Attach volume vol-044c54d4e2fcfdeed to instance i-0a2b4c45d44211a2b as device /dev/sdf.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Create a new EBS volume
Why: Extra data disks keep app data apart from the root disk.
What to do: Create a 20 GiB gp3 volume in Availability Zone eu-north-1a.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Find a disk's UUID
Why: /etc/fstab should use the UUID, because device names can change after a reboot.
What to do: Show the UUID of /dev/xvdf.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Medium Format a new disk
Why: A new EBS volume is empty. It needs a file system before you can store files.
What to do: Format /dev/xvdf with the xfs file system.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Hard Grow a volume without downtime
Why: EBS volumes can grow while in use. Afterwards you grow the file system too.
What to do: Increase volume vol-044c54d4e2fcfdeed to 50 GiB.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Hard Find big files
Why: When the disk is full, find large files first.
What to do: Find files bigger than 100 MB anywhere under /var.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Hard Resize an instance (vertical scaling)
Why: When the server is too small, change its type while it is stopped.
What to do: The stopped instance i-0a2b4c45d44211a2b needs more power. Change its instance type to t3.large.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.