# info > CFDISK

---
type: CommandReference
command: cfdisk
mode: man
section: 8
source: man-pages
---

## Quick Reference

- `cfdisk` — launch cfdisk on default device /dev/sda
- `cfdisk -z` — start with zeroed partition table (new)
- `cfdisk --read-only` — open in read-only mode
- `n` — create new partition from free space
- `d` — delete current partition
- `W` — write partition table to disk (requires confirmation)
- `q` — quit without writing
- `t` — change partition type

## Name

cfdisk - display or manipulate a disk partition table

## Synopsis

`cfdisk [options] [device]`

## Options

- `-h, --help` — display help text and exit
- `-L, --color[=when]` — colorize output; `when` can be `auto`, `never`, or `always` (default `auto`)
- `--lock[=mode]` — use exclusive BSD lock; `mode` can be `yes`, `no`, or `nonblock` (default `yes`); overrides `$LOCK_BLOCK_DEVICE`
- `-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 (does not erase disk)

## Commands

- `b` — toggle bootable flag on current partition
- `d` — delete current partition (converts to free space)
- `h` — show help screen
- `n` — create new partition from free space; prompts for size (suffixes: KiB, MiB, GiB, etc.)
- `q` — quit without writing
- `r` — resize current partition; prompts for new size
- `s` — sort partitions in ascending start-sector order
- `t` — change partition type (default: Linux)
- `u` — dump current partition table to an sfdisk-compatible script file
- `W` — write partition table to disk (requires confirmation `yes`/`no`)
- `x` — toggle extra information about a partition
- `Up/Down` — move cursor between partitions
- `Left/Right` — select menu item; `Enter` executes; `Esc` returns to main menu

## See Also

[fdisk(8)](https://www.chedong.com/phpMan.php/man/fdisk/8/markdown), [parted(8)](https://www.chedong.com/phpMan.php/man/parted/8/markdown), [partprobe(8)](https://www.chedong.com/phpMan.php/man/partprobe/8/markdown), [partx(8)](https://www.chedong.com/phpMan.php/man/partx/8/markdown), [sfdisk(8)](https://www.chedong.com/phpMan.php/man/sfdisk/8/markdown)