How to move EBS volume to a different EC2 Instance across availability zones

Steps:

  1. Create snapshot of EBS volume
  2. Create new EBS volume from snapshot in the required Availability Zone
  3. Attach volume to EC2 Instance
  4. Mount and modify fstab

This article explain the process of moving EBS volume to an EC2 instance that is hosted in a different availability zone. Click here to see the instructions for moving EBS volume to a different Instance within the same availability zone.

I have 2 EC2 instances,zone1 and zone2, running in 2 different availability zones.

Instance zone1 has 2 volumes Zone1-Vol1 and Zone1-Vol2 and Instance zone2 has 1 volume Zone2-Vol1. I’m going to move volume Zone1-Vol2 to the zone2 EC2 instance.

Right click on the volume and choose Create Snapshot.

Provide a name and description for the snapshot and choose Create Snapshot.

On the snapshots dashboard, you will see a new snapshot being created. Wait until the status changes from pending to completed and right click on the snapshot. Choose Create Volume.

Enter values for availability zone(should be the same as the zone2 EC2 Instance) and volume name and choose Create Volume.

You will see a new volume in available state. Right click on the volume and choose Attach Volume.

Select the Instance that you would like to attach the volume to and choose Attach.

SSH into the zone2 instance and create a mount point for the new volume and mount the volume.

Finally add the volume’s uuid to the fstab file to make sure it is mounted after server reboot.

Success !!! Volume from EC2 Instance in AZ1 has been moved to an EC2 Instance in AZ2. If you do not require the volume in AZ1 anymore, you can unmount the volume, detach it from the EC2 Instance and delete it.

See also  How to view all active sessions in Redshift database

You might also be interested in