As we learn about the AWS EC2 instance and there storage if we want to make the partition on that storage as we make in our pc like C Drive, E drive, D drive … etc by using the command line then we have to perform the following steps that are given below :
Make the EC2 instance on AWS by going to the services and at the top, then go to the volume option as there is also some volume allocated to your instance but we have to add more volume so there is an option of the attach volume click on it as shown in the fig below
After attaching the volume we have the screen like given below we have to make give the instance ID or our virtual machine ID and our device name this will you get from your instance.
After this it will automatically create a voloum and you can access it by going to the voloum option that is given below and run the following command to make tthe partition.
This command shows you the storage available on your instance.
Then we have to go the run the command .
And it will give us the following output that is given in the fig below.
After this, it will show Command (m for help ) and when we press m and click on enter then there is a menu like given in the below figure.
Then we have to press n for the partition type and here we chose the primary partition, so we press p and give the partitions number it will be from 1 to 4 and the first sector we make it by default and then click enter and after that we press p and enter so that we can see that our partition is made or not as given in the below figure.
After that press w from confirmation of the partition as shown in the figure.
After that check the partition by using the fdisk -l command as shown in the figure there is a new partition created by the name of the /dev/xvdf1 .
Now we have to mount our partition so that our partition will be permanent to do that we have to run the following command that is given below and their implementation is shown in the figure.
This command is used to change the format of the partition that we have make on cloud.
mount /dev/xvdf /mnt
It will mount the /dev/xvdf partition and make an directory in it which have name as mnt.
This command is used to check the size used avail used percentage mounted on.
As our partition is made on cloud so we are going to make some directory on mnt folder as show in the fig below.
By the following step we are going to make the partition on cloud.