Section: System Administration (8)
Updated: March 2014
cfdisk is a curses/slang-based program for partitioning any block device. The default device is /dev/sda.
Since version 2.25 cfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
- -h, --help
- Display help text and exit.:
- -L, --color[=when]
- Colorize the output; enabled by default. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto.:
- -V, --version
- Display version information and exit.:
- -z, --zero
- Start with an in-memory zeroed partition table. This option does not zero the partition table on the disk; rather, it simply starts the program without reading the existing partition table.:
The commands for cfdisk can be entered by pressing the corresponding key (pressing Enter after the command is not necessary). Here is a list of the available commands:
- Toggle the bootable flag of the current partition. This allows you to select which primary partition is bootable on the drive. This command may not be available for all partition label types.:
- Delete the current partition. This will convert the current partition into free space and merge it with any free space immediately surrounding the current partition. A partition already marked as free space or marked as unusable cannot be deleted.:
- Show the help screen.:
- Create a new partition from free space. cfdisk then prompts you for the size of the partition you want to create. The default size is equal to the entire available free space at the current position.
The size may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB").
- Quit the program. This will exit the program without writing any data to the disk.:
- Change the partition type. By default, new partitions are created as Linux partitions.:
- Write the partition table to disk (you must enter an uppercase W). Since this might destroy data on the disk, you must either confirm or deny the write by entering `yes' or `no'. If you enter `yes', cfdisk will write the partition table to disk and then tell the kernel to re-read the partition table from the disk.
- Up Arrow, Down Arrow
- Move the cursor to the previous or next partition. If there are more partitions than can be displayed on a screen, you can display the next (previous) set of partitions by moving down (up) at the last (first) partition displayed on the screen.:
All commands can be entered with either uppercase or lowercase letters (except for Write). When in a submenu or at a prompt for entering a size, you can hit the ESC key to return to the main menu.
Implicit coloring can be disabled by creating the empty file /etc/terminal-colors.d/cfdisk.disable.
See (5) for more details about colorization configuration.
cfdisk does not support color customization with a color-scheme file.
Karel Zak <[email protected]>
The current cfdisk implementation is based on the original cfdisk from Kevin E. Martin ([email protected]).
The cfdisk command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.