Copy AWS EBS Volumes from one Region to Another Regions | Automate EBS Volume Backup
Here’s a step-by-step guide to transfer the EBS Volume from one region to another region without loosing any data. This blog provides a comprehensive walkthrough of the process, making it easy for beginners.
EBS (Elastic Block Store) volume is like a virtual hard drive in the cloud. It provides scalable and persistent storage for your Amazon EC2 instances in AWS. You can think of it as a digital disk that you can attach to your virtual servers to store data, just like a physical hard drive in your computer.
Step 1: Launch an EC2 Instance in the N. Virginia Region
Log in to your AWS Management Console.
Navigate to the EC2 Dashboard and click “Launch Instance.”
Here you can see our instance is running on “us-east-1a” availability zone.
Step 2: Create an EBS Volume in the N. Virginia Region
Click on Create volume,
Here in the Size you can give according your requirements, I have given 5GiB
And in the Availability Zone make sure to select those availability zone where we have launched our instance(N. Virginia Region).
Here you can give the Tags and click on Create volume.
Now select your instance and click on connect you can use other tools for login.
lsblk
command is used to list the partitions and their details on a Linux system.
here you can see only one disk is attached.
Now let’s attach the EBS volume, select the volume that we have created, click on action and click on Attach volume
Here select the instance that we have launched and click on Attach volume.
Connect the instance and see new disk is attached.
Step 3: Store Data in the EBS Volume
for storing the data in the ebs volume we have to create a partition. To create a partition we have to go inside the hard disk with sudo fdisk /dev/xvdf
command.
● Type n
for new partition
● type p
for primary partition
● partition number 1
● First sector enter ● command to specify the Size +100M
● Type w
this command will save the partition
The lsblk
command in Linux is used to list information about block devices, Here you can see one partitons is created.
Step 4: Create a Snapshot of the EBS Volume
For creating a snapshot select the ebs volume and click on action and click Create snapshot.
Give the tags and click on create snapshot.
Step 5: Copy Snapshot to the Ohio Region
Now copy this snapshot in which region you want, I am copying to the Ohio Region, for this select snapshot and click on action and click on Copy snapshot.
Select the Destination Region in my case it’s us-east-2 and click on copy snapshot.
Step 6: Create an EC2 Instance in the Ohio Region
Navigate to the EC2 Dashboard in the Ohio region.
Click “Launch Instance.”
Choose an AMI and configure the instance in Ohio.
Step 7: Create EBS volume from snapshot and attach to the instance.
In the Ohio region, go to ec2 dashboard, where click on Snapshot here you can see the one snapshot is copied from N.Virginia region(us-east-1).
Now select this snapshot and click on actions and click on Create volume from snapshot.
Here you can define the size of volume how many size you want according you can give, I have just given 5GiB.
And select Availability Zone where our instance is running in the Ohio region in my case it’s running in us-east2a AZ and click on create volume.
Now login to the console switch to root user and check the list of disk here you can see only one disk is attached
Now attach the volume to the instance, select the volume and click on actions and click on Attach volume.
Here select the instance which we have launched and click on attach volume.
now check the list of disk by lsblk
command, here you can see one more disk is come up which size is 5GiB.
Automate EBS Volume Backup- EBS Lifecycle Manager - EBS Backup
go to ec2 dashboard, where click on Lifecycle Manager here you can see the Create new lifecycle policy
Here select the Volume and Target resource tags which we have already created
Configure schedule - Schedule name is Schedule 1 and every one hour automatically EBS Volume take a Backup on daily basis
Click on Create Policy
Now, Data Lifecycle Manager is Enabled
Now, we can see that every one hour it automatically takes a snapshot
keep learning keep sharing
Thank you for taking the time to read…….