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:
You can see it’s showing here on the server.
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
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
A file system has been created and we check using the same command as earlier.
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.
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.
First, you have to unmount it from the instance using umount /var/www/. Once it’s done.
Now go to the EBS -> Volume and select the attached volume & click on Detach volume.
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.
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