How To Make EBS Volume To Use On AWS Cloud

When you add a fresh additional EBS volume to your instance. This is a block device and you will have to format it and mount on the directory to use. We can mount and use free EBS volume usage and space in AWS. We just need to mount it on a directory. Let’s see, how to make EBS.

How To Make EBS Volume To Use On AWS Cloud:

Now check the attached disk is showing on the EC2 instance using lsblk and I have attached the additional disk size of 2 Gb and the device name is /dev/xvdf.

Check Out: Learn Useful Tar Command With Example In Linux

You can see it’s showing here on the server.

use ebs volume

Now we can check whether is data or file system. It’s obvious the new disk will be data but it’s good to check before formatting the disk.

file -s /dev/xvdf

aws mount ebs

It’s a data disk and we have to format it to use because there’s no file system present to write the data on this disk.

mkfs -t ext4 /dev/xvdf

ebs volume usage aws

Check Out: How To Secure Apache Web With Server Hardening In Linux

A file system has been created and we check using the same command as earlier.

aws volume free space

I will try to mount it on /var/www directory.

mount /dev/xvdf /var/www/

Check it’s correctly mounted or not using mount -a. if you don’t see any error, it means correctly mounted.

aws increase volume size windows

df -h

mount ebs volume to ec2 instance linux

I have created a directory inside-mounted point to check if I detach it from the server, I’m able to get the data or not.

mkdir testdata

First, you have to unmount it from the instance using umount /var/www/. Once it’s done.

Check Out: How To Configure Autoscaling Setup On Amazon Cloud

Now go to the EBS -> Volume and select the attached volume & click on Detach volume.

how to check ebs volume in aws

Click on Yes, Detach

Check on the server it’s still showing or not using lsblk command.

The EBS Volume is not present here and I will attach it again to check the data which I created before these steps.

Check Out: Windows Screen lock Automatically Using Group Policy

The device type will be present here and mount it on the directory as we have shown earlier. You can see the below screenshot we have the data we created during to test it.

To make it permanent you can make an entry in /vim/fstab file.

/dev/xvdf /var/www ext4 defaults 0 0

You’re done. use ebs volume aws mount free space usage

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment