CFDISK(8)
๐ cfdisk(8) โ display or manipulate a disk partition table
okay so bestie, you know that moment when your disk is a whole mess and you need to slice it up? yeah. this is the manual page for cfdisk, a system administration (section 8) tool, and it is genuinely the cutest way to do partition surgery. sit down, grab a snack ๐, and let's get into it.
โจ SYNOPSIS โจ
cfdisk [options] [device]
that's it. that's the whole vibe. ๐
๐ DESCRIPTION ๐
cfdisk is a curses-based program for partitioning any block device. if you don't tell it which device you want, it just defaults to /dev/sda like it owns the place.
note that cfdisk provides basic partitioning functionality with a user-friendly interface. so if you need the fancy advanced features, bestie, go use fdisk(8) instead. no shame in it, they're cousins. ๐ซถ
all disk label changes will remain in memory only, and the disk will be unmodified until you decide to write your changes. so be careful before using the write command. like, really careful. this is the part where you read the warning and actually listen to it. ๐
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. and honestly? CHS has never been important for Linux, and this addressing concept does not make any sense for new devices. it's giving ancient. ๐ฆ
since version 2.25, cfdisk also does not provide a 'print' command any more. that functionality is provided by the utilities partx(8) and lsblk(8) in a very comfortable and rich way. they ate that, honestly. ๐ฅ
if you want to remove an old partition table from a device, use wipefs(8). clean slate energy. โจ
๐ OPTIONS ๐
-L,--color[=when]โ colorize the output. the optional argument when can beauto,neveroralways. if the when argument is omitted, it defaults toauto. the colors can be disabled, for the current built-in default see--helpoutput. see also the COLORS section. ๐--lock[=mode]โ use an exclusive BSD lock for the device or file that is operated upon. the optional argument mode can beyes(1),no(0), ornonblock. if the mode argument is omitted, it defaults toyes. this option overrides the environment variable$LOCK_BLOCK_DEVICE. the default is to not use any lock at all, but using a lock is recommended to avoid collisions withsystemd-udevd(8)or other tools. protect your peace (and your partitions). ๐-r,--read-onlyโ forced open in read-only mode. look, don't touch. ๐-b,--sector-sizesectorsize โ specify the sector size of the disk. valid values are512,1024,2048, and4096. the kernel is aware of the sector size for regular block devices. use this option only on very old kernels, when working with disk images, or to override the kernel's default sector size. sinceutil-linux-2.17,fdiskdistinguishes between logical and physical sector size. this option changes both sector sizes to the specified sectorsize.-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 ansfdisk(8)-compatible script. fresh start, main character energy. ๐-h,--helpโ display help text and exit.-V,--versionโ display version and exit.
๐ COMMANDS ๐
the commands for cfdisk can be entered by pressing the corresponding key โ and pressing Enter after the command is not necessary. here is a list of the available commands:
bโ 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.dโ 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. bye bye ๐hโ show the help screen.nโ create a new partition from free space.cfdiskthen 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"). math girlies rise ๐ง
qโ quit the program. this will exit the program without writing any data to the disk. the safest exit, fr fr.rโ reduce or enlarge the current partition.cfdiskthen prompts you for the new size of the partition. the default size is the current size. a partition marked as free space or marked as unusable cannot be resized.
note that reducing the size of a partition might destroy data on that partition. ๐ญ please be careful bestie.
sโ sort the partitions in ascending start-sector order. when deleting and adding partitions, it is likely that the numbering of the partitions will no longer match their order on the disk. this command restores that match. order restored, we love to see it. โจtโ change the partition type. by default, new partitions are created as Linux partitions.uโ dump the current in-memory partition table to ansfdisk(8)-compatible script file.
the script files are compatible between cfdisk, fdisk(8), sfdisk(8) and other libfdisk applications. for more details see sfdisk(8).
it is also possible to load an sfdisk-script into cfdisk if there is no partition table on the device or when you start cfdisk with the --zero command-line option.
Wโ write the partition table to disk (you must enter an uppercaseW). since this might destroy data on the disk, you must either confirm or deny the write by enteringyesorno. if you enteryes,cfdiskwill write the partition table to disk and then tell the kernel to re-read the partition table from the disk.
the re-reading of the partition table does not always work. in such a case you need to inform the kernel about any new partitions by using partprobe(8) or partx(8), or by rebooting the system. the classic "have you tried turning it off and on again" but make it partitions. ๐
xโ toggle extra information about a partition.- 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.
- Left Arrow, Right Arrow โ select the preceding or the next menu item. hitting Enter will execute the currently selected item.
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. escape room, but make it a partition table. ๐ช
๐ COLORS ๐
the output colorization is implemented by terminal-colors.d(5) functionality. implicit coloring can be disabled by an empty file
/etc/terminal-colors.d/cfdisk.disable
for the cfdisk command, or for all tools by
/etc/terminal-colors.d/disable
since version 2.41, the $NO_COLOR environment variable is also supported to disable output colorization unless explicitly enabled by a command-line option.
the user-specific $XDG_CONFIG_HOME/terminal-colors.d or $HOME/.config/terminal-colors.d overrides the global setting.
note that the output colorization may be enabled by default, and in this case terminal-colors.d directories do not have to exist yet. sneaky. ๐
cfdisk does not support color customization with a color-scheme file. you get what you get and it's still cute. ๐
๐ฆ ENVIRONMENT ๐ฆ
CFDISK_DEBUG=allโ enablescfdiskdebug output.LIBFDISK_DEBUG=allโ enableslibfdiskdebug output.LIBBLKID_DEBUG=allโ enableslibblkiddebug output.LIBSMARTCOLS_DEBUG=allโ enableslibsmartcolsdebug output.LIBSMARTCOLS_DEBUG_PADDING=onโ use visible padding characters.LOCK_BLOCK_DEVICE=<mode>โ use exclusive BSD lock. the mode is"1"or"0". see--lockfor more details.
๐ซถ AUTHORS ๐ซถ
Karel Zak <kzak@redhat.com> โ icon, legend, the moment. โจ
the current cfdisk implementation is based on the original cfdisk from Kevin E. Martin <martin@cs.unc.edu> โ the OG. ๐
โญ SEE ALSO โญ
fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)
๐ REPORTING BUGS ๐
for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. tell them everything, bestie, they wanna know. ๐ฅ
๐ธ 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/>.
and that's the whole page, no cap! ๐ this was util-linux 2.42.4, dated 2026-09-21, and you just read the entire cfdisk(8) manual like a true main character. go partition something (carefully!!) and slay ๐
โจ๐
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms