How to Attach AWS EBS Volume to AWS EC2 Instances
2. How to attach AWS EBS volume to any running EC2 instances?
3. How to create filesystem on AWS EBS volume?
4. How to mount AWS EBS volume on EC2 instances?
How to Attach AWS EBS Volume to AWS EC2 Instances
Step 1: Select correct EC2 instance
Make sure you have selected the correct EC2 instances to which we are going to add additional or new aws EBS volume.
Step 2: Identify AWS Availability Zone
Go to storage section, find how many EBS volumes have been attached to aws EC2.
So primarily you’ll be having a root EBS volume and also identify the availability zone of EC2 instance where it is running.
We can attach multiple aws EBS volumes to a single instances but the volumes we create and the instance must be in the same availability zone.
Step 3: Create new AWS EBS Volume
Go to volumes and Click on Create volume.
Specify new AWS EBS Volume details like Volume type, size, IOPS, Throughput, Availability Zone and other info as you prefered. Dont forget to select the right availability zone of our EC2 is running.
Once you entered all details, just click on create volume.
Go to volumes again to verify the state of newly created AWS EBS Volume. it should be in ‘available’ state for now.
Step 4: Attach new AWS EBS Volume
Go to actions, Click on Attach volume.
Note: Volume Status will be changed from “Available” to “In Use”.
Step 5: Create filesystem & mount AWS EBS Volume on AWS EC2
Login into EC2 instance and find the new device id that is created by OS kernel using “fdisk -l” or “lsblk” commands.
sudo lsblk
sudo fdisk -l
In order to mount this volume we have to create a file system. Lets create a xfs file system type on this EBS volume.
sudo mkfs.xfs /dev/xvdf
Mount volume on a target directory using mount command.
sudo mount /dev/xvdf /mnt
Hope this post helped you with How to Attach AWS EBS Volume to AWS EC2 Instances. Keep practicing and have fun. Leave your comments if any.
DevOps Full Course Tutorial for Beginners – DevOps Free Training Online
Docker Full Course Tutorial for Beginners – Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners – Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners – Ansible Free Training Online
Openstack Full Course Tutorial for Beginners – Openstack Free Training Online
Learn Linux, DevOps and Cloud
Keep practicing and have fun. Leave your comments if any.
Support Us: Share with your friends and groups.
Stay connected with us on social networking sites, Thank you.