How To Create a New Disk on Linux

In this article, we want to teach you How To Create a New Disk on Linux. You can manage data by using the disk partition. A disk partition is a logical division of an HDD or SSD. Creating a new disk on Linux allows you to install multiple operating systems (dual-booting), organize data, improve system performance, and isolate the operating system from user data for easier backups or recovery.

This tutorial on the Orcacore website shows you how to create a new disk partition on your Linux server.

How To Create a New Disk on Linux?

In this guide, we will use the fdisk command to create a new disk on Linux servers. To complete this guide, log in to your server as a root user or non-root user with sudo privileges and follow the steps below.

Add a new Disk Partition on Linux

As we said, we want to use the fdisk command to create a new disk. You can use fdisk to create and manipulate disk partition tables.

List Current Partitions on Linux

First, you can display your current partitions by using the following fdisk command on Linux:

fdisk -l

For example, you have /dev/sda disk, and /dev/sda1 and /dev/sda2 as partitions.

List Current Partitions on Linux

Add a new disk partition on Linux

At this point, you can use the following fdisk command on your Linux server to create a new partition in /dev/sda:

fdisk /dev/sda

With this command, you will open the fdisk prompt.

Add a new disk partition on Linux

Type n and press Enter to create a new partition. Then, you have to select between creating a primary or an extended partition. Here, we choose the recommended one as the primary partition. So choose p and press enter.

Next, you have to enter the partition number and the size of the partition in sectors. After that, you need to write the changes to the disk by typing w and pressing Enter. 

Finally, you can verify your added disk by using the command below:

fdisk /dev/sda

fdisk commands and options

Here are some commonly used fdisk commands listed below:

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

Conclusion

At this point, you have learned to create a New Disk on Linux with the fdisk command. You can use fdisk to create and manipulate disk partition tables.

Hope you enjoy it. Please subscribe to us on Facebook and YouTube.

You may like these articles too:

Find Hard Disk Information on Linux

How To Disable Remote Access in MySQL Database

How To Manually Install Driver Module in Linux

Share your love

Stay informed and not overwhelmed, subscribe now!