Day 12.Attach Volume to EC2 Instance

Published: (December 7, 2025 at 10:17 AM EST)
1 min read
Source: Dev.to

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

    1. Open the EC2 service.
    2. In the left panel, click Volumes (under “Elastic Block Store”).
    3. Find devops-volume.
    4. Ensure its state is available and note its Availability Zone (AZ).
    5. The EC2 instance must be in the same AZ as the volume.

    Volume list

  • Check the Instance

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

    Instance list

  • Attach the Volume

    1. Return to Volumes.
    2. Select devops-volume.
    3. Click Actions → Attach volume.
    4. In the popup:
      • Instance: choose devops-ec2
      • Device name: enter /dev/sdb
    5. Click Attach volume.

    Attach volume dialog

  • Verify Attachment
    After attaching:

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

    Attachment info

    On the EC2 devops-ec2 instance page:

    • Open the Storage tab.
    • You should now see an additional block device listed as /dev/sdb.

    Storage tab

Back to Blog

Related posts

Read more »