• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Create Disk Partitions using cfdisk

by admin

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

cfdisk view disk partitions

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

cfdisk create new partition

2. Select the partition type as ‘primary’ on the next screen.

create primary partition using cfdisk

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.

select size in cfdisk menu

4. Now specify the start of the partition as ‘beginning of free space’.

add partition at the beginning of the free space cfdisk

5. To save the changes, write the partition table to the disk on the next screen.

write partition table to disk cfdisk

6. print the partition table and verify the new partition either using cfdisk menu option or ‘fdisk -l /dev/sdb’ command.

partition table print in cfdisk

Understanding linux fdisk utility
Understanding linux parted utility

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to delete unused kernels and keep only the running kernel in CentOS/RHEL
  2. Linux OS Service ‘ldap’
  3. CentOS / RHEL : Resize (reduce) non-root EXT3/4 filesystem on non-LVM device (hard disk partition)
  4. LVM Configuration : Volume Group (VG) Operations/Utilities
  5. locale Command Examples in Linux
  6. Basic “ls” Command examples in Linux
  7. How to Enable sudo I/O Logging
  8. Understanding /etc/group file
  9. How To Configure 802.1q VLAN On NIC On CentOS/RHEL 7 and 8
  10. pinky Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • What are /dev/zero and /dev/null files in Linux
  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright