• 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 Change the Default Shell In Linux
  2. How to Install awscli
  3. CentOS / RHEL 7 : How to follow the mount order in /etc/fstab
  4. dumpe2fs: command not found
  5. acpi Command Examples in Linux
  6. pscp – ssh_init: Network error: Cannot assign requested address
  7. Linux Vs Windows – Why Linux Is Better For Programming & Web Dev
  8. e2label: command not found
  9. rpc.statd[PID]: Failed to create listener xprt (statd, 1, udp6) – CentOS/RHEL 6, 7
  10. run-mailcap: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Chezmoi: A multi-machine dotfile manager, written in Go
  • cheat: Create and view interactive cheat sheets on the command-line
  • chars: Display names and codes for various ASCII and Unicode characters and code points
  • chafa: Image printing in the terminal

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright