Elastic Block Storage
Elastic Block Storage (EBS) is a virtual block device. we can think of it as a hard drive in a physical on premises system, although it is really a bunch of software magic to link into another kind of storage device but make it look like a hard drive(HDD) to an instance.
EBS is just the name for the service. Inside of EBS we have what are called volumes. These are the “units” amazon is selling to us. We create a volume and they allocate X number of gigabytes and we use it like a hard drive that we can plug into any of your running computers (instances) on AWS Cloud.
Types of EBS
Volumes: EBS can either be created blank or from a snapshot copy of the previous volume.
Types of EBS volumes and their Configurations:
Snapshots of volumes: It is an exact capture of what a volume looked like at a particular moment in time, including all of its data saved on volume.
Resize Existing EBS Volume :
Step 1: Go to Volume from the left panel. Select the volume you want to modify and click on Modify Volume
Step 2: Set your desired size and click on Modify.
Step 3: You will find the screen below.
Step 4: Congrats you just Modified EBS volume.
Note : please make sure to restart your instance if it is attached to any instance.
How to Migrate your EBS Volume:
For demo purpose, we have two instances with different Availability zones
Step1 : Go to volumes and Create snapshot of desired volume
Step 2: Now create volume through a snapshot on the desired availability zone which means at the time of creation of the volume from the snapshot at that time you can choose the desired Availability Zone.
Note: please make sure, in which Availability Zone you are creating your volume only that Availability Zone’s instance can attach this volume only.
Step 3: After creating volume you have to attach to a particular instance.
Attaching EBS volumes.
Step 4: Now Login to your instance and mount new volume through below command.
sudo mount /dev/xvdf /u01
Note: if you already logged in using super user no need to use sudo before mount command, in below example we are not using sudo as we logged in using super user.