How to Attach EBS to EC2 instance?
Steps to Attach EBS block to EC2 instance.

Hi, I am Yogesh, a Full Stack Developer, passionate about developing production-ready applications. I have Good knowledge and expertise in Python, Django, JavaScript, React.js, Next.js, React-Native, SQL, Docker, AWS, Linux, Leadership Skills, and Soft skills.
I believe continuous learning and development to keep myself up-to-date and up-skilled is the solution to modern-day application development for customers.
Amazon Elastic Block Store (Amazon EBS) is an easy-to-use, scalable, high-performance block-storage service designed for Amazon Elastic Compute Cloud (Amazon EC2).
Note:- My EBS block name is xvdf, so be carefull when writing block name
- To attached EBS, it should be in same Availability zone.
- Now create an EBS and provide the size.
- Now open EBS dashboard and attach it to the same availability zone instance.
- Now SSH that instance and type lsblk and hit Enter, Now you can see all the storage of that instance.
- But you can't access it now, to access it we have to format that EBS storage.
- To format it, type this in your root directory sudo mkfs.ext4 /dev/xvdf
- Now that EBS is formatted and ready to use, but not mounted.
- To mount it Go to root directory using cd/ , now type mkdir /new_volume/
- Now type mount /dev/xvdf /new_volume/ hit enter, and you are DONE!!
- To check type mountpoint /new_volume

To de-attach that EBS from EC2
- Go outside from that EBS directory and type umount /new_volume/
- Now detach this EBS from AWS EBS Dashboard. Done!!



