{
    "mode": "man",
    "parameter": "cfdisk",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/cfdisk/8/json",
    "generated": "2026-06-10T16:07:37Z",
    "synopsis": "cfdisk [options] [device]",
    "sections": {
        "NAME": {
            "content": "cfdisk - display or manipulate a disk partition table\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "cfdisk [options] [device]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "cfdisk is a curses-based program for partitioning any block device. The default device is\n/dev/sda.\n\nNote that cfdisk provides basic partitioning functionality with a user-friendly interface. If\nyou need advanced features, use fdisk(8) instead.\n\nAll disk label changes will remain in memory only, and the disk will be unmodified until you\ndecide to write your changes. Be careful before using the write command.\n\nSince version 2.25 cfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer\nprovides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been\nimportant for Linux, and this addressing concept does not make any sense for new devices.\n\nSince version 2.25 cfdisk also does not provide a 'print' command any more. This\nfunctionality is provided by the utilities partx(8) and lsblk(8) in a very comfortable and\nrich way.\n\nIf you want to remove an old partition table from a device, use wipefs(8).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-L --color",
                    "content": "Colorize the output. The optional argument when can be auto, never or always. If the when\nargument is omitted, it defaults to auto. The colors can be disabled, for the current\nbuilt-in default see --help output. See also the COLORS section.\n\n--lock[=mode]\nUse exclusive BSD lock for device or file it operates. The optional argument mode can be\nyes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to \"yes\".\nThis option overwrites environment variable $LOCKBLOCKDEVICE. The default is not to use\nany lock at all, but it’s recommended to avoid collisions with udevd or other tools.\n",
                    "flag": "-L",
                    "long": "--color"
                },
                {
                    "name": "-r --read-only",
                    "content": "Forced open in read-only mode.\n",
                    "flag": "-r",
                    "long": "--read-only"
                },
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-z --zero",
                    "content": "Start with an in-memory zeroed partition table. This option does not zero the partition\ntable on the disk; rather, it simply starts the program without reading the existing\npartition table. This option allows you to create a new partition table from scratch or\nfrom an sfdisk(8)-compatible script.\n",
                    "flag": "-z",
                    "long": "--zero"
                }
            ]
        },
        "COMMANDS": {
            "content": "The commands for cfdisk can be entered by pressing the corresponding key (pressing Enter\nafter the command is not necessary). Here is a list of the available commands:\n\nb\nToggle the bootable flag of the current partition. This allows you to select which\nprimary partition is bootable on the drive. This command may not be available for all\npartition label types.\n\nd\nDelete the current partition. This will convert the current partition into free space and\nmerge it with any free space immediately surrounding the current partition. A partition\nalready marked as free space or marked as unusable cannot be deleted.\n\nh\nShow the help screen.\n\nn\nCreate a new partition from free space. cfdisk then prompts you for the size of the\npartition you want to create. The default size is equal to the entire available free\nspace at the current position.\n\nThe size may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and\nso on for GiB, TiB, PiB, EiB, ZiB and YiB (the \"iB\" is optional, e.g., \"K\" has the same\nmeaning as \"KiB\").\n\nq\nQuit the program. This will exit the program without writing any data to the disk.\n\nr\nReduce or enlarge the current partition. cfdisk then prompts you for the new size of the\npartition. The default size is the current size. A partition marked as free space or\nmarked as unusable cannot be resized.\n\nNote that reducing the size of a partition might destroy data on that partition.\n\ns\nSort the partitions in ascending start-sector order. When deleting and adding partitions,\nit is likely that the numbering of the partitions will no longer match their order on the\ndisk. This command restores that match.\n\nt\nChange the partition type. By default, new partitions are created as Linux partitions.\n\nu\nDump the current in-memory partition table to an sfdisk-compatible script file.\n\nThe script files are compatible between cfdisk, fdisk(8) sfdisk(8) and other libfdisk\napplications. For more details see sfdisk(8).\n\nIt is also possible to load an sfdisk-script into cfdisk if there is no partition table\non the device or when you start cfdisk with the --zero command-line option.\n\nW\nWrite the partition table to disk (you must enter an uppercase W). Since this might\ndestroy data on the disk, you must either confirm or deny the write by entering `yes' or\n`no'. If you enter `yes', cfdisk will write the partition table to disk and then tell the\nkernel to re-read the partition table from the disk.\n\nThe re-reading of the partition table does not always work. In such a case you need to\ninform the kernel about any new partitions by using partprobe(8) or partx(8), or by\nrebooting the system.\n\nx\nToggle extra information about a partition.\n\nUp Arrow, Down Arrow\nMove the cursor to the previous or next partition. If there are more partitions than can\nbe displayed on a screen, you can display the next (previous) set of partitions by moving\ndown (up) at the last (first) partition displayed on the screen.\n\nLeft Arrow, Right Arrow\nSelect the preceding or the next menu item. Hitting Enter will execute the currently\nselected item.\n\nAll commands can be entered with either uppercase or lowercase letters (except for Write).\nWhen in a submenu or at a prompt, you can hit the Esc key to return to the main menu.\n",
            "subsections": []
        },
        "COLORS": {
            "content": "Implicit coloring can be disabled by creating the empty file\n/etc/terminal-colors.d/cfdisk.disable.\n\nSee terminal-colors.d(5) for more details about colorization configuration.\n\ncfdisk does not support color customization with a color-scheme file.\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "CFDISKDEBUG=all\nenables cfdisk debug output.\n\nLIBFDISKDEBUG=all\nenables libfdisk debug output.\n\nLIBBLKIDDEBUG=all\nenables libblkid debug output.\n\nLIBSMARTCOLSDEBUG=all\nenables libsmartcols debug output.\n\nLIBSMARTCOLSDEBUGPADDING=on\nuse visible padding characters. Requires enabled LIBSMARTCOLSDEBUG.\n\nLOCKBLOCKDEVICE=<mode>\nuse exclusive BSD lock. The mode is \"1\" or \"0\". See --lock for more details.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Karel Zak <kzak@redhat.com>\n\nThe current cfdisk implementation is based on the original cfdisk from Kevin E. Martin\n<martin@cs.unc.edu>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The cfdisk command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-08-10                                    CFDISK(8)",
            "subsections": []
        }
    },
    "summary": "cfdisk - display or manipulate a disk partition table",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        },
        {
            "flag": "-L",
            "long": "--color",
            "arg": null,
            "description": "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 $LOCKBLOCKDEVICE. The default is not to use any lock at all, but it’s recommended to avoid collisions with udevd or other tools."
        },
        {
            "flag": "-r",
            "long": "--read-only",
            "arg": null,
            "description": "Forced open in read-only mode."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-z",
            "long": "--zero",
            "arg": null,
            "description": "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."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "fdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/fdisk/8/json"
        },
        {
            "name": "parted",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/parted/8/json"
        },
        {
            "name": "partprobe",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/partprobe/8/json"
        },
        {
            "name": "partx",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/partx/8/json"
        },
        {
            "name": "sfdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sfdisk/8/json"
        }
    ]
}