Day 12.Attach Volume to EC2 Instance
Source: Dev.to
Lab Information
The Nautilus DevOps team is creating services on AWS and breaking the migration into smaller tasks for better control, risk mitigation, and resource optimization.
An instance named devops-ec2 and a volume named devops-volume already exist in the us-east-1 region. Attach the devops-volume to the devops-ec2 instance, setting the device name to /dev/sdb.
Lab Solutions
Step‑By‑Step Instructions (AWS Console)
-
Log in
Use the provided console URL and credentials. Confirm the region is us-east-1. -
Check Volume Availability
- Open the EC2 service.
- In the left panel, click Volumes (under “Elastic Block Store”).
- Find devops-volume.
- Ensure its state is available and note its Availability Zone (AZ).
- The EC2 instance must be in the same AZ as the volume.

-
Check the Instance
- Go to Instances.
- Locate devops-ec2.
- Verify it is in the same Availability Zone as the volume.
- The instance can be running; attaching works for both stopped and running states.

-
Attach the Volume
- Return to Volumes.
- Select devops-volume.
- Click Actions → Attach volume.
- In the popup:
- Instance: choose devops-ec2
- Device name: enter /dev/sdb
- Click Attach volume.

-
Verify Attachment
After attaching:- Volume state should change to in‑use.
- Under Attachment information, you should see:
- Instance ID: devops-ec2
- Device: /dev/sdb

On the EC2 devops-ec2 instance page:
- Open the Storage tab.
- You should now see an additional block device listed as /dev/sdb.
