So, when we want to attach a volume of different availability zone to an instance then the concept of SNAPSHOT comes into the picture.
Suppose you have an instance, in ap-south-1a availability zone.!
Now, suppose you have a volume of 15GB in different availability zone let it be in ap-south-1b.
Then go the volume(which you want to attach) -> go to actions -> create snapshot -> add a description -> add tag (value = description name)-> create snapshot.
Now, go to Snapshots you will find that a snapshot of your volume is being created.
Now, we need to create volume from the snapshot.
So, go to actions -> click on create volume from snapshot -> give size according to your wish -> change the availability zone according to the instance with which you want to attach the volume -> Give tag -> Create volume.
Now, go to volumes you will find a new volume is created.
Now, you can add the new volume to your instance by following the below steps.
Step 1: Go to Xshell then type sudo su then type lsblk
We will fing a 8G volume is mounted into the root (/).
Step 2: Then we need to add the volume to our instance so, go to
your AWS console and then go to the volume section. Click on the volume you want to attach to your instance then go to actions -> click on attach volume, then follow the below steps.
Step 3: Then go to Xshell, type lsblk, it will show that the
extra volume is attached to the instance.
Now, type df -h, we will find that the new volume is not showing on the instance details which means the new volume is attached but not mounted into the instance.
So, to mount the volume here are the following steps:
Step1 : Type mkdir /india (making a directory)
Step2 : Type cd /india (changing directory)
Then type mount /dev/xvdf /india/. Now, our EBS volume is mounted on our AWS instance.
We can also check it by typing df -h, then we will see the 15G storage used in the our directory India.
This is the whole process by which you can connect the volume and instance of different availability zones.
Top comments (0)