How to Use fdisk Command to Create Partition in Linux


The fdisk command software comes in handy for viewing and modifying exhausting disk or SSD walls on Linux and its distributions, equivalent to Ubuntu. It is among the maximum robust equipment to control disk walls on Linux. Other equipment also are to be had to accomplish disk partition on Linux, however fdisk is among the maximum repeatedly used ones.

fdisk is a menu-driven command-line software, and therefore new customers to find this device complicated and hard to make use of. fdisk isn’t a very simple device to make use of and must be used with warning. You want to have root get right of entry to or sudo privileges to make adjustments to garage walls.

So, lately on this article, I can come up with an instructional on learn how to create a partition in Linux the use of the fdisk command.

You can perform the next operations the use of the fdisk command.

  • Create New Partition
  • Manage Space
  • Reorganize area on previous drives.
  • Move knowledge to a brand new disk

How to listing walls?

Before making any adjustments to the force, you first take a look at the fundamental construction of the force and its walls. To view the entire walls at the force, run the next command within the Linux terminal.

Partitions are displayed by means of their instrument title, equivalent to dev/sda, dev/sdc, and many others., as you’ll be able to see within the above screenshot.

If you want to view partition at the explicit disk, it’s important to use ‘-l’ adopted by means of the instrument title as proven within the command underneath.

$ sudo fdisk -l /dev/sda3

This command will display the output as proven within the screenshot underneath.

Creating Partition:

To create a partition on a particular force, it’s important to run the fdisk command with the instrument title, as proven within the command underneath.

Once you’re at the instrument the place you need to create a partition, kind M and press input.

You will see the listing as proven underneath screenshot. This is the listing of single-letter instructions you’ll be able to use to take explicit motion the use of fdisk.

To create a partition, it’s important to use the N command. Both logical and number one walls can also be created the place I denote logical partition and P denotes number one partition.

By default, the primary unfastened sector at the disk is selected to create a brand new partition. Just like that, you additionally must specify the remaining sector of the partition. You too can specify the scale of the partition in keeping with your requirement.

Deleting Partition:

To delete the particular partition, it’s important to use the D command. Use the P command to verify which partition you need to delete.

When you fireplace the D command, it’s going to ask for the partition quantity you need to delete. Just kind that partition quantity and hit the input button. This will delete the chosen partition.

So, that is how you’ll be able to use the fdisk command to create and delete the partition on Linux. fdisk is an overly helpful command-line device when used successfully and accurately. Make positive you’ve gotten the again of the walls the place you will use the fdisk command. Good day!

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More