cfdisk is used to create, delete, and modify partitions on a disk device. Enter the cfdisk command and include the device that you want to partition as an argument. Example:
# cfdisk /dev/sda
Summary information for the disk device is displayed at the top of the window. The partition table is displayed in the middle of the window. Selectable commands are displayed in brackets at the bottom of the window.
Use the up and down arrow keys to select a partition from the list. Use the right and left arrows to select a command. All partition-specific commands apply to the current partition.
In the example shown in the picture above, two primary partition exists, sda1 and sda2. The free space is selected in the upper portion of the window and the [New] menu option is selected at the bottom of the window.
Creating partitions using cfdisk
Creating a new partition with cfdisk is easy as the cfdisk is an interactive utility. Follow the steps below to create a primary partition of 200MB in size.
1. First, select the option new in the cfdisk menu.
# cfdisk /dev/sdb
2. Select the partition type as ‘primary’ on the next screen.
3. On the next screen specify the size of the partition you want to create. In our example we will create a partition of 200MB.
4. Now specify the start of the partition as ‘beginning of free space’.
5. To save the changes, write the partition table to the disk on the next screen.
6. print the partition table and verify the new partition either using cfdisk menu option or ‘fdisk -l /dev/sdb’ command.