There are upcoming maintenance events which may impact our services. Learn more

How to Add a New Disk (Block Storage) to an Existing Linux Server and Windows Server Print

  • 7

In this article, I will take you through the steps by which we can add the new raw hard disk to an existing Linux server such as RHEL/CentOS or Debian/Ubuntu.

First Add your Block Storage please following https://my.letbox.com/knowledgebase.php?action=displayarticle&catid=2&id=58

Important: Please note that the purpose of this article is to show only how to create a new partition and doesn’t include partition extension or any other switches.

I am using fdisk utility to do this configuration.

I have added a hard disk of 247G capacity to be mounted as a /data partition.

fdisk is a command line utility to view and manage hard disks and partitions on Linux systems.

# fdisk -l 

 

This will list the current partitions and configurations.

 

New disk added is shown as /dev/vdb. If we are adding the Block Storage as SATA or SCI it will show as /dev/sda based of the disk type. Here I used a Virtio disk.

To partition a particular hard disk, for example /dev/vdb

# fdisk /dev/vdb
 

Commonly used fdisk commands.

  • n – Create partition
  • p – print partition table
  • d – delete a partition
  • q – exit without saving the changes
  • w – write the changes and exit.

Optional : If your Block Storage bigger than 2TB you need to run 

g


Here since we are creating a partition use n option.


Create either primary/extended partitions. By default we can have upto 4 primary partitions.

 


Give the partition number as desired. Recommended to go for the default value 1.



Give the value of the first sector. If it is a new disk, always select default value. If you are creating a second partition on the same disk, we need to add 1 to the last sector of the previous partition.



Give the value of the last sector or the partition size,  always select default value.to avoid value out of range error.



Save the changes and exit.






Now format the disk with mkfs command.

# mkfs.ext4 /dev/vdb1

 



Once formatting has been completed, now mount the partition as shown below.



# mkdir /data
# mount /dev/vdb1 /data

Make an entry in /etc/fstab file for permanent mount at boot time.

/dev/vdb1	/data	ext4	defaults     0   0



Windows operations

Start by opening the Disk Management panel by right-clicking the Windows Start button and select Disk Management from the appearing list. Alternatively, type diskmgmt.msc in the search or run window and then pressing enter.

The newly attached storage device should be listed as the last disk in the bottom part of the window. Start by right-clicking the new disk and selecting Online to enable the device.




Next, you will need to initialize it by right-clicking the disk and selecting Initialize Disk



In the next window, initialize the newly attached disk by selecting MBR and clicking OK.




Before the new disk can be accessed you will need to format it. Right-click the unallocated partition and select New Simple Volume. Go through the wizard, the default options are fine for most cases.




The formatting might take a moment depending on the size of the new volume. You can continue using the server normally until the process is completed.




Once the volume creation wizard is done formatting the new partition, the device will show with blue indicator and report status as Healthy. Done! You can then start using the added storage space as usual.



Was this answer helpful?

« Back