Creating Elastic Block Storage | Mount EBS in linux
In this blog you will Learn how to attach EBS vloume to EC2 instance
Go to EC2 dashboard > volumes
Here you can see I have two volumes already created to create another new volume click create volume.
-
Select your volume type. what space you require for your storage in GiB.
Availability zone - Check your instance from which Availability zone and then create for example if your instance belongs from us-east-1e but you are creating volume in us-east-1a you can not connect your instance to this volume.
Snapshot ID - If you already created snapshot create with it.
tags - Labels
Click on create Volume
Volume is created now it's time to connect with your instance.
volume is created in this region us-east-1e.
before attaching new volume I will show how many storage volumes connected with instance.
Here xvda and xvdb is connected to instance. lsblk is command to check how many volumes is connected with instance.
Lets connect another volume to the instance.
After connecting successfully you can see extra volume is name with xvdf is connected.
Before using volume to create partition format it must.
sudo mkfs.ext4 /dev/xvdf
Give file allocation so we can move or copy data from the volume.
volume is mounted.
To unmount volume from the instance.