NAME
cfdisk - display or manipulate a disk partition tableSYNOPSIS
cfdisk [options] [device]DESCRIPTION
cfdisk is a curses-based program for partitioning any block device. The default device is /dev/sda.OPTIONS
-h, --helpDisplay help text and exit.
Print version and exit.
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.
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 systemd-udevd(8) or
other tools.
Forced open in read-only mode.
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: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.
Reduce or enlarge the current partition.
cfdisk then 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.
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.
Change the partition type. By default, new
partitions are created as Linux partitions.
Dump the current in-memory partition table to
an sfdisk(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.
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.
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.
Toggle extra information about a
partition.
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.
Select the preceding or the next menu item.
Hitting Enter will execute the currently selected item.
COLORS
The output colorization is implemented by terminal-colors.d(5) functionality. Implicit coloring can be disabled by an empty fileENVIRONMENT
CFDISK_DEBUG=allenables cfdisk debug output.
enables libfdisk debug output.
enables libblkid debug output.
enables libsmartcols debug output.
use visible padding characters. Requires
enabled LIBSMARTCOLS_DEBUG.
use exclusive BSD lock. The mode is
"1" or "0". See --lock for more details.
AUTHORS
Karel <[email protected]>ZakSEE ALSO
fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/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/>.2022-05-11 | util-linux 2.38.1 |