GPT fdisk is a text-mode family of programs for creation and manipulation of partition tables. The cgdisk member of this family employs a curses-based user interface for interaction using a text-mode menuing system. It will automatically convert an old-style Master Boot Record (MBR) partition table or BSD disklabel stored without an MBR carrier partition to the newer Globally Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID partition table. Other members of this program family are gdisk (the most feature-rich program of the group, with a non-curses-based interactive user interface) and sgdisk (which is driven via command-line options for use by experts or in scripts). FixParts is a related program for fixing a limited set of problems with MBR disks.
For information on MBR vs. GPT, as well as GPT terminology and structure, see the extended GPT fdisk documentation at https://www.rodsbooks.com/gdisk/ or consult Wikipedia.
The cgdisk program employs a user interface similar to that of Linux's cfdisk, but cgdisk modifies GPT partitions. It also has the capability of transforming MBR partitions or BSD disklabels into GPT partitions. Like the original cfdisk program, cgdisk does not modify disk structures until you explicitly write them to disk, so if you make a mistake, you can exit from the program with the Quit option to leave your partitions unmodified.
Ordinarily, cgdisk operates on disk device files, such as /dev/sda or /dev/hda under Linux, /dev/disk0 under Mac OS X, or /dev/ad0 or /dev/da0 under FreeBSD. The program can also operate on disk image files, which can be either copies of whole disks (made with dd, for instance) or raw disk images used by emulators such as QEMU or VMWare. Note that only raw disk images are supported; cgdisk cannot work on compressed or other advanced disk image formats.
Upon start, cgdisk attempts to identify the partition type in use on the disk. If it finds valid GPT data, cgdisk will use it. If cgdisk finds a valid MBR or BSD disklabel but no GPT data, it will attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are likely to have unusable first and/or final partitions because they overlap with the GPT data structures, though.) Upon exiting with the 'w' option, cgdisk replaces the MBR or disklabel with a GPT. This action is potentially dangerous! Your system may become unbootable, and partition type codes may become corrupted if the disk uses unrecognized type codes. Boot problems are particularly likely if you're multi-booting with any GPT-unaware OS. If you mistakenly launch cgdisk on an MBR disk, you can safely exit the program without making any changes by using the Quit option.
When creating a fresh partition table, certain considerations may be in order:
Only one command-line option is accepted, aside from the device filename: -a. This option alters the highlighting of partitions and blocks of free space: Instead of using ncurses, when -a is used cgdisk uses a ">" symbol to the left of the selected partition or free space. This option is intended for use on limited display devices such as teletypes and screen readers.
Interactions with cgdisk occur with its interactive text-mode menus. The display is broken into two interactive parts:
In addition, the top of the display shows the program's name and version number, the device filename associated with the disk, and the disk's size in both sectors and IEEE-1541 units (GiB, TiB, and so on).
You can use the following keys to move among the various options and to select among them:
If more partitions exist than can be displayed in one screen, you can scroll between screens using the partition selection keys, much as in a text editor.
Available options are as described below. (Note that cgdisk provides a much more limited set of options than its sibling gdisk. If you need to perform partition table recovery, hybrid MBR modification, or other advanced operations, you should consult the gdisk documentation.)
Known bugs and limitations include:
Contributors:
* Yves Blusseau (1otnwmz02@sneakemail.com)
* David Hubbard (david.c.hubbard@gmail.com)
* Justin Maggard (justin.maggard@netgear.com)
* Dwight Schauer (das@teegra.net)
* Florian Zumbiehl (florz@florz.de)
https://en.wikipedia.org/wiki/GUID_Partition_Table
https://developer.apple.com/technotes/tn2006/tn2166.html
https://www.rodsbooks.com/gdisk/