Search notes:

Shell command: fdisk

fdisk is a dialog-driven tool to create and manipulate GPT, MBR, Sun, SGI and BSD partition tables.

Command line options

-b --sector-size size Specify the sector size (512, 1024, 2048 or 4096) of the disk. Only or old kernels (or to force a size) since recent kernels know the sector size.
-B --protect-boot Don't erase the beginning of the first disk sector when creating a new disk label (GPT and MBR).
-c --compatibility [=mode] Specify the compatibility mode (dos or nondos, the latter being the default).
-L --color [=when] Colored output. The optional when can be auto (default), never or always.
-l --list List the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if it exists) are used.
-x --list-details Like --list, but showing more details.
--lock[=mode] Use exclusive BSD lock for device or file it operates.
-n --noauto-pt Don't automatically create a default partition table on empty device. (The partition table has to be explicitly created using commands such as o, g, etc.).
-o --output list Specify which output columns to print. The default list of columns may be extended if list is specified in the format +list (e.g., -o +UUID).
-s --getsz Print the size in 512-byte sectors of each given block device. Deprectated in favor of blockdev.
-t --type type Enable support only for disklabels of the specified type, and disable support for all other types.
-u --units [=unit] When listing partition tables, show sizes in sectors (default) or in cylinders.
-C --cylinders N Specify the number of cylinders of the disk. Usefulnes of this option is very dubious.
-H --heads N Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
-S --sectors N Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
-w --wipe when Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument when can be auto (default), never or always. See also wipefs
-W --wipe-partitions when like --wipe, but for newly created partitions.
-V --version
-h --help

See also

gdisk, sgdisk
Shell commands

Index