Understanding and Using the Fdisk Command in Linux

04 May 2023 Balmiki Mandal 0 Linux

Fdisk Command in Linux

The fdisk command is one of the most useful and important commands used in Linux, as it allows users to manage disk partitioning. With the fdisk command, users can create, delete, modify and display information about disk partitions. It allows users to create both primary and extended partitions, as well as modify their characteristics such as the size and type.

The fdisk command is part of the util-linux package, which is a standard part of most Linux distributions. This command is also available in some other operating systems, such as Solaris and FreeBSD.

Using Fdisk

When using the fdisk command, the first argument must be the name of the device you would like to manipulate. For example, if you want to access the hard drive with the device name /dev/sda, the command should look like this:

fdisk /dev/sda

Once you have chosen the correct device to manipulate, you will be presented with a list of options for managing the device. The most common options are as follows:

  • p – view a list of partitions on the device
  • n – create a new partition
  • d – delete a partition
  • q – quit fdisk

The fdisk command is an incredibly powerful tool which can be used to perform many different operations on disk partitions. However, it is important to be careful when using it, as it can easily result in the loss of important data. As such, it is always advisable to have a backup of your data before running the fdisk command.

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.