This content originally appeared on DEV Community and was authored by Gurlal Sidhu
Moving volumes across two regions is not permitted, however, creating a snapshot of a volume and then moving to another region is allowed. Let's see how it is done:
- Launch two instances in different regions( us-east-1 and us-west-1)
-
Create a volume in the first region (us-east-1)
- Go to EC2, under Elastic Block Store (left pane), and click on Volumes
- Create volume. The size of this volume would be 10 GB
- Once it is successfully created, you will see its state set to available
-
Now right on newly created volume and select ‘attach volume’
- Select your instance, leave the device as it is - /dev/sdf and attach. It will take a couple of minutes to attach the volume.
- Now Connect to your EC2 Instance - either via SSH or connect directly from the portal. I will be connecting from the portal (it will open in another tab).
- First thing first, switch to root user - sudo su
- check if the attached volume is listed - lsblk
- New volumes don’t file system configure, set up a file system for this volume - mkfs -t xfs /dev/xvdf
- Create a mount point for your volume -mkdir gsdata and mount the volume - mount /dev/xvdf /gsdata
- Going to check if I can see all my buckets - aws s3 ls
- Copy files from Testing Vol folder in inpuutbuckgs bucket to /gsdata - aws s3 cp S3://inputbuckgs/TestingVol /gsdata --recursive
- Check moved files - ls -l /gsdata
- Now you could create directories upload files to this volume. I’ll create a test folder and move some files from s3 bucket.
- Before you copy files from the s3 bucket, you will need to configure your AWS profile. I have it already configured.
- Now go back to the EC2 portal, and create a snapshot of the volume
- Right-click on the volume and select ‘create a snapshot’, Type in the description on the prompted screen, and create Snapshot
- Go to Snapshots under Elastic Block Store, right-click on this new snapshot, and select copy
- Select the region where you want to copy, add a description, and copy
- Select your instance, leave the device as it is - /dev/sdf and attach. It will take a couple of minutes to attach the volume.
-
Go to another region, check your snapshot that you just copied, it could take depending on the size of your snapshot
- Right-click on the snapshot and create Volume
- Select the size, type, and region on the prompted screen. Increasing size is ok, but if you try to reduce the size, you may experience data lose
EBS volume has been moved to another region. However, I am going to attach an instance in this region to show you that there was no data lost since the last snapshot
-
Attach the volume like we did it above for an instance in us-east-1 region and connect to EC2 Instance
- Please don’t try to format the file system again, it will delete your data. Just mount the volume here. As you can see here, all the files that were uploaded in the us-east-1 region were available here.
- Please don’t try to format the file system again, it will delete your data. Just mount the volume here. As you can see here, all the files that were uploaded in the us-east-1 region were available here.
Now detach your volumes in both regions, delete volumes and snapshot, and terminate your instance to avoid any charges from AWS
Use case Scenarios of what we did above:
- Perform a backup of your volume in another region.
- Restore volume in another region from snapshot
- Please Note: you could also create a Snapshot Lifecycle Policy that will create snapshots of your volume hourly, every two or four hours, or daily and retain those snapshots up to desired days.
This content originally appeared on DEV Community and was authored by Gurlal Sidhu

Gurlal Sidhu | Sciencx (2021-11-20T07:16:21+00:00) How To Move an EBS volume to another region?. Retrieved from https://www.scien.cx/2021/11/20/how-to-move-an-ebs-volume-to-another-region/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.