info > CFDISK

๐Ÿท๏ธ NAME

cfdisk - display or manipulate a disk partition table

๐Ÿš€ Quick Reference

Use Case Command Description
Start interactive session cfdisk [device] Launch cfdisk for a block device (default: /dev/sda)
Create new partition n (interactive) Create a new partition from free space; prompts for size
Delete a partition d (interactive) Delete the current partition, turning it into free space
Write changes to disk W (interactive then yes) Write partition table to disk and re-read it
Change partition type t (interactive) Change the type of the current partition (default: Linux)
Resize a partition r (interactive) Reduce or enlarge the current partition (โš ๏ธ may destroy data)
Toggle bootable flag b (interactive) Set/unset the bootable flag on the current partition
Sort partitions s (interactive) Sort partitions in ascending start-sector order
Dump partition table to script u (interactive) Save the current in-memory table as an sfdisk-compatible script
Quit without saving q (interactive) Exit the program without writing any data
Start with zeroed partition table cfdisk --zero [device] Start with a blank in-memory table (ignores existing partitions)

๐Ÿ“‹ SYNOPSIS

cfdisk [options] [device]

๐Ÿ“– DESCRIPTION

cfdisk is a curses-based program for partitioning any block device. The default device is /dev/sda.

Note that cfdisk provides basic partitioning functionality with a user-friendly interface. If you need advanced features, use fdisk(8) instead.

All disk label changes will remain in memory only, and the disk will be unmodified until you decide to write your changes. ๐Ÿ’ก Be careful before using the write command.

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.

Since version 2.25 cfdisk also does not provide a 'print' command any more. This functionality is provided by the utilities partx(8) and lsblk(8) in a very comfortable and rich way.

If you want to remove an old partition table from a device, use wipefs(8).

โš™๏ธ OPTIONS

๐Ÿ”น -h, --help

Display help text and exit.

๐Ÿ”น -L, --color[=when]

Colorize the output. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto. The colors can be disabled, for the current built-in default see --help output. See also the COLORS section.

๐Ÿ”น --lock[=mode]

Use exclusive BSD lock for device or file it operates. The optional argument mode can be yes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to "yes". This option overwrites environment variable $LOCK_BLOCK_DEVICE. The default is not to use any lock at all, but itโ€™s recommended to avoid collisions with udevd or other tools.

๐Ÿ”น -r, --read-only

Forced open in read-only mode.

๐Ÿ”น -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. This option allows you to create a new partition table from scratch or from an sfdisk(8)-compatible script.

๐ŸŽฎ COMMANDS

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:

All commands can be entered with either uppercase or lowercase letters (except for Write). When in a submenu or at a prompt, you can hit the Esc key to return to the main menu.

๐ŸŽจ COLORS

Implicit coloring can be disabled by creating the empty file /etc/terminal-colors.d/cfdisk.disable.

See terminal-colors.d(5) for more details about colorization configuration.

cfdisk does not support color customization with a color-scheme file.

๐ŸŒ ENVIRONMENT

๐Ÿ”น CFDISK_DEBUG=all

enables cfdisk debug output.

๐Ÿ”น LIBFDISK_DEBUG=all

enables libfdisk debug output.

๐Ÿ”น LIBBLKID_DEBUG=all

enables libblkid debug output.

๐Ÿ”น LIBSMARTCOLS_DEBUG=all

enables libsmartcols debug output.

๐Ÿ”น LIBSMARTCOLS_DEBUG_PADDING=on

use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.

๐Ÿ”น LOCK_BLOCK_DEVICE=<mode>

use exclusive BSD lock. The mode is "1" or "0". See --lock for more details.

๐Ÿ‘ค AUTHORS

Karel Zak <kzak AT redhat.com>

The current cfdisk implementation is based on the original cfdisk from Kevin E. Martin <martin AT cs.edu>.

๐Ÿ“š SEE ALSO

fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)

๐Ÿ› REPORTING BUGS

For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.

๐Ÿ“ฆ AVAILABILITY

The cfdisk command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.

util-linux 2.37.2 2021-08-10 CFDISK(8)

CFDISK
๐Ÿท๏ธ NAME ๐Ÿš€ Quick Reference ๐Ÿ“‹ SYNOPSIS ๐Ÿ“– DESCRIPTION โš™๏ธ OPTIONS
๐Ÿ”น -h, --help ๐Ÿ”น -L, --color[=when] ๐Ÿ”น --lock[=mode] ๐Ÿ”น -r, --read-only ๐Ÿ”น -V, --version ๐Ÿ”น -z, --zero
๐ŸŽฎ COMMANDS ๐ŸŽจ COLORS ๐ŸŒ ENVIRONMENT
๐Ÿ”น CFDISK_DEBUG=all ๐Ÿ”น LIBFDISK_DEBUG=all ๐Ÿ”น LIBBLKID_DEBUG=all ๐Ÿ”น LIBSMARTCOLS_DEBUG=all ๐Ÿ”น LIBSMARTCOLS_DEBUG_PADDING=on ๐Ÿ”น LOCK_BLOCK_DEVICE=<mode>
๐Ÿ‘ค AUTHORS ๐Ÿ“š SEE ALSO ๐Ÿ› REPORTING BUGS ๐Ÿ“ฆ AVAILABILITY

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:49 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!