How to make Storage Partition on Cloud

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 :

Step-1:
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



Step-2:
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.

Step-3:
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.

fdisk -l 



This command shows you the storage available on your instance.

Step-4:
Then we have to go the run the command .

fdisk /dev/xvdf 

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.

Step-5:
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.



Step-6:
After that press w from confirmation of the partition as shown in the figure.

Step-7:
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 .

Step-8:
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.

mkfs.ext4 /dev/xvdf1 

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.

df -h 

This command is used to check the size used avail used percentage mounted on.

Step-9:
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.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.