How to Partition and Mount Instance Storage in Linux-based Operating Systems

Once an instance is created, sometimes it may need more storage or separate storage for backups. This article will discuss how to add new instance storage and partition it in Linux-based operating systems. 


Adding a New Instance Storage


To add new instance storage, follow the steps below:

  • Go to: Arvan Cloud User Panel > Cloud Computing > Block Storage.
  • Click on: New Volume
  • In the pop-up window, enter the intended Name and needed Volume.
  • Click on: Create Volume. 

Once the new Volume is created, choose the instance that needs more storage, and add the link. Then connect to the instance. To know more about this, read the SSH Access to Instance article. 

Tips: The root access must be available for all these instructions.

To make sure of the added new storage, use the command below. The new storage is placed at the end of the output, and no partition is specified for it. 

There are two ways to use the new storage:

  • Converting the whole storage into a file system.
  • Partitioning,


Converting the New Instance Storage into a File System 


  • To do so, use the command below.

Please note that this will turn the whole new disk storage into a file system, and future partitioning will eliminate all the saved data on this storage. 

  • To use the formatted storage, it needs to be mounted to a directory. Use the command below. (Instead of youredirectoryname, use the intended Name. For instance, Arvan Cloud used “sample.”)
  • To be sure about mounting this storage to a directory, use the commands below:


Partitioning the New Instance Storage 

This will make it possible to divide the new instance storage into different partitions and store different sets of data on each of them. To partition new instance storage, follow this instruction:

  • Use the command below.
  • To create a partition, use “n.”
  • Specify the type of partition which can be primary or extended. For instance, here, “p” is used for the primary partition.
  • Use a number for the intended partition. 
  • Determine the specific storage for the partition. 
  • To assign the whole storage to one specific partition, pass the next two steps by clicking on “enter.”
  • And finally, use “w.” 
  • Then, the new partition must be formatted. To do so, use the command below:
  • First, to mount the new partition to a directory, create a directory, and mount the intended partition to it. To make sure, use the command below: