Open In App

How to make Storage Partition on Cloud

Last Updated : 03 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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 

GfG-mk

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. 

 

GfG-attach-3-2-(1)
Step-3: 
After this it will automatically create a volume and you can access it by going to the volume option that is given below and run the following command to make the partition. 
 

fdisk -l 

GfG-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. 

GfG-dev
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. 

 

GfG-m

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. 

 

GfG-n-p

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

GfG-w

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 . 

GfG-fdiska
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. 

GfG-mount

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.

GfG-mk-(1)
By the following step we are going to make the partition on cloud.
 



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads