π§± Expanding Your Horizons: Attaching Extra Storage to Your Cloud Server
Hey Cloud Builders! π
Welcome to Day 12 of the #100DaysOfCloud Challenge: Attach EBS Volume! We are continuing our systematic infrastructure migration with KodeKloud Engineer. Today, we are bridging the gap between compute and storage.
Our mission: Attach the existing EBS volume named nautilus-volume to the EC2 instance named nautilus-ec2 in the us-east-1 region using the device name /dev/sdb.
1. Introduction: Why Attach a Secondary Volume? π‘
Most EC2 instances come with a "Root Volume" where the Operating System lives. However, in professional DevOps, we often attach secondary volumes for specific data.
- Data Separation: Keeping your application data or databases on a separate volume makes it easier to manage backups (snapshots) and move data between instances.
-
Performance: You can choose different volume types (like
io2for high-speed databases) for your data volume while keeping a standardgp3for your OS. - Persistence: If the OS crashes and you need to delete the instance, the secondary data volume can be easily detached and saved!
Let's get this "virtual hard drive" plugged in! π
2. Step-by-Step Guide: Attaching nautilus-volume to nautilus-ec2
We will use the EC2 Dashboard to perform this operation.
Step 2.1: Locate your EBS Volume
- Log in to the AWS Console and navigate to the EC2 Dashboard.
- In the left sidebar, scroll down to "Elastic Block Store" and click on "Volumes".
- Find the volume named
nautilus-volume.
Pro-Tip: Ensure the volume state is "available" (meaning it's not currently attached to anything else).
Step 2.2: Attach to the Instance
- Select the checkbox for
nautilus-volume.
- Click the "Actions" button and select "Attach volume".
- In the Instance search box, click and select your instance:
nautilus-ec2. - Device name: This is a crucial step for this task! Delete the default suggestion and type:
/dev/sdb. - Click "Attach volume".
Step 2.3: Verify the Attachment
- Refresh your Volumes list. The state of
nautilus-volumeshould now be "in-use". - Go to the EC2 Dashboard, select
nautilus-ec2, and click the Storage tab. You should now see two volumes listed under Block devices: the root volume and your new/dev/sdbvolume!
Success! Your server has now been upgraded with extra storage space. π
3. Key Takeaways π
-
The AZ Rule: An EBS Volume must be in the exact same Availability Zone (e.g.,
us-east-1a) as the EC2 instance to be attached. -
Device Names: In modern Linux instances, even if you specify
/dev/sdbin AWS, the OS might see it as/dev/xvdbor/dev/nvme1n1. - Hot-Plugging: You can attach EBS volumes while the instance is running!
4. Common Mistakes to Avoid π«
- Availability Zone Mismatch: If you can't find your instance in the dropdown, 99% of the time it's because the volume and instance are in different AZs.
- Forgetting to Mount: Attaching the volume in AWS is like plugging in a USB drive. You still need to log into the Linux server to format the disk and mount it to a directory before you can use it!
- Device Name Confusion: Always double-check the requirements. Some legacy systems specifically look for certain device paths.
5. Conclusion + Call to Action! π
You've successfully managed the storage lifecycle of your cloud resources! Learning to handle EBS volumes is a core skill for anyone managing databases or stateful applications in AWS.
How are you finding the 100 Days of Cloud Challenge so far? π‘οΈ
- π¬ Letβs connect on LinkedIn: Are you a "GP3 by default" person or do you prefer other volume types? π Hritik Raj
- β Support my journey on GitHub: Check out my repository for all 100 days of cloud tasks. π GitHub β 100 Days of Cloud










Top comments (0)