]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/fdisk.8
Place SEE ALSO entries in order
[thirdparty/util-linux.git] / disk-utils / fdisk.8
index 94081efa1f2dfbf1487f986caf06f2ad9624e485..cdb3168238e5325dfeb25687425237a6ae4957f9 100644 (file)
@@ -3,14 +3,14 @@
 .\" Copyright 2012 Davidlohr Bueso <dave@gnu.org>
 .\" Copyright (C) 2013 Karel Zak <kzak@redhat.com>
 .\" May be distributed under the GNU General Public License
-.TH FDISK 8 "September 2013" "util-linux" "System Administration"
+.TH FDISK 8 "February 2016" "util-linux" "System Administration"
 
 .SH NAME
 fdisk \- manipulate disk partition table
 
 .SH SYNOPSIS
 .B fdisk
-.RB [ options ]
+[options]
 .I device
 .sp
 .B fdisk \-l
@@ -46,67 +46,103 @@ is not guaranteed.  The input (the commands) should always be backward compatibl
 
 .SH OPTIONS
 .TP
-.BI "\-b " sectorsize
+\fB\-b\fR, \fB\-\-sector\-size\fR \fIsectorsize\fP
 Specify the sector size of the disk.  Valid values are 512, 1024, 2048, and 4096.
 (Recent kernels know the sector size.  Use this option only on old kernels or
 to override the kernel's ideas.)  Since util-linux-2.17, \fBfdisk\fR differentiates
 between logical and physical sector size.  This option changes both sector sizes to
 .IB sectorsize .
 .TP
-.BR "\-c"[=\fImode\fR]
+\fB\-B\fR, \fB\-\-protect\-boot\fP
+Don't erase the begin of the first disk sector when create a new disk label.  This
+feature is supported for GPT and MBR.
+.TP
+\fB\-c\fR, \fB\-\-compatibility\fR[=\fImode\fR]
 Specify the compatibility mode, 'dos' or 'nondos'.  The default is non-DOS
 mode.  For backward compatibility, it is possible to use the option without
 the \fImode\fR argument -- then the default is used.  Note that the optional
 \fImode\fR argument cannot be separated from the \fB-c\fR option by a space,
-the correct form is for example '-c=dos'.  This option is DEPRECATED.
-.TP
-.BI "\-C " cylinders
-Specify the number of cylinders of the disk.
-I have no idea why anybody would want to do so.  This option is DEPRECATED.
-.TP
-.BI "\-H " heads
-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.  This option is DEPRECATED.
-.TP
-.BI "\-S " sectors
-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.  This option is DEPRECATED.
+the correct form is for example '-c=dos'.
 .TP
-.BI \-h
+\fB\-h\fR, \fB\-\-help\fR
 Display a help text and exit.
 .TP
-.BR "\-L"[=\fIwhen\fR]
-Colorize the output in interactive mode.  The optional argument \fIwhen\fP can
-be \fBauto\fR, \fBnever\fR or \fBalways\fR.  The default is \fBauto\fR.
+\fB\-L\fR, \fB\-\-color\fR[=\fIwhen\fR]
+Colorize the output.  The optional argument \fIwhen\fP
+can be \fBauto\fR, \fBnever\fR or \fBalways\fR.  If the \fIwhen\fR argument is omitted,
+it defaults to \fBauto\fR.  The colors can be disabled; for the current built-in default
+see the \fB\-\-help\fR output.  See also the \fBCOLORS\fR section.
 .TP
-.B \-l
+\fB\-l\fR, \fB\-\-list\fR
 List the partition tables for the specified devices and then exit.
 If no devices are given, those mentioned in
 .I /proc/partitions
 (if that file exists) are used.
 .TP
-.BI "\-s " partition...
-Print the size (in blocks) of each given partition.  This option is DEPRECATED
+.BR \-o , " \-\-output " \fIlist\fP
+Specify which output columns to print.  Use
+.B \-\-help
+to get a list of all supported columns.
+
+The default list of columns may be extended if \fIlist\fP is
+specified in the format \fI+list\fP (e.g. \fB-o +UUID\fP).
+.TP
+\fB\-s\fR, \fB\-\-getsz\fR
+Print the size in 512-byte sectors of each given block device.  This option is DEPRECATED
 in favour of
 .BR blockdev (1).
 .TP
-.BI "\-t " type
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
 Enable support only for disklabels of the specified \fItype\fP, and disable
 support for all other types.
-This is necessary for example to access a protective or hybrid MBR on devices
-with GPT.
 .TP
-.BR "\-u"[=\fIunit\fR]
+\fB\-u\fR, \fB\-\-units\fR[=\fIunit\fR]
 When listing partition tables, show sizes in 'sectors' or in 'cylinders'.  The
 default is to show sizes in sectors.  For backward compatibility, it is possible
 to use the option without the \fIunit\fR argument -- then the default is used.
 Note that the optional \fIunit\fR argument cannot be separated from the \fB-u\fR
 option by a space, the correct form is for example '-u=cylinders'.
+
+.TP
+\fB\-C\fR, \fB\-\-cylinders\fR \fInumber\fR
+Specify the number of cylinders of the disk.
+I have no idea why anybody would want to do so.
+.TP
+\fB\-H\fR, \fB\-\-heads\fR \fInumber\fR
+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.
 .TP
-.B \-v
+\fB\-S\fR, \fB\-\-sectors\fR \fInumber\fR
+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.
+
+.TP
+\fB\-w\fR, \fB\-\-wipe\fR \fIwhen\fR
+Wipe filesystem, RAID and partition-table signatures from the device, in order
+to avoid possible collisions.  The argument \fIwhen\fR can be \fBauto\fR,
+\fBnever\fR or \fBalways\fR.  When this option is not given, the default is
+\fBauto\fR, in which case signatures are wiped only when in interactive mode.
+In all cases detected signatures are reported by warning messages
+before a new partition table is created.  See also
+.BR wipefs (8)
+command.
+
+.TP
+\fB\-W\fR, \fB\-\-wipe-partition\fR \fIwhen\fR
+Wipe filesystem, RAID and partition-table signatures from a newly created
+partitions, in order to avoid possible collisions.  The argument \fIwhen\fR can
+be \fBauto\fR, \fBnever\fR or \fBalways\fR.  When this option is not given, the
+default is \fBauto\fR, in which case signatures are wiped only when in
+interactive mode and after confirmation by user.  In all cases detected
+signatures are reported by warning messages before a new partition is
+created.  See also
+.BR wipefs (8)
+command.
+
+.TP
+\fB\-V\fR, \fB\-\-version\fR
 Display version information and exit.
 
 .SH DEVICES
@@ -123,6 +159,36 @@ is a device name followed by a partition number.  For example, /dev/sda1 is the
 first partition on the first hard disk in the system.  See also Linux kernel
 documentation (the Documentation/devices.txt file).
 
+.SH SIZES
+The "last sector" dialog accepts partition size specified by number of sectors
+or by +<size>{K,B,M,G,...} notation. 
+
+If the size is prefixed by  '+' then it is interpreted as relative to the
+partition first sector. In this case the size is expected in bytes and the
+number may be followed by the multiplicative suffixes 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". 
+
+The relative sizes are always aligned according to device I/O limits.  The
++<size>{K,B,M,G,...} notation is recommended.
+
+For backward compatibility fdisk also accepts the suffixes KB=1000,
+MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes
+are deprecated.
+
+.SH SCRIPT FILES
+.B fdisk
+allows to read (by 'I' command) sfdisk compatible script files. The script is
+applied to in-memory partition table, and then it is possible to modify the
+partition table before you write it to the device.
+.PP
+And vice-versa it is possible to write the current in-memory disk layout
+to the script file by command 'O'.
+.PP
+The script files are compatible between cfdisk, sfdisk, fdisk and another
+libfdisk applications. For more details see
+.BR sfdisk (8).
+
 .SH DISK LABELS
 .B GPT (GUID Partition Table)
 .RS
@@ -280,13 +346,22 @@ The original version was written by
 Andries E. Brouwer, A. V. Le Blanc and others.
 
 .SH ENVIRONMENT
-.IP "Setting LIBFDISK_DEBUG=0xffff enables debug output."
+.IP FDISK_DEBUG=all
+enables fdisk debug output.
+.IP LIBFDISK_DEBUG=all
+enables libfdisk debug output.
+.IP LIBBLKID_DEBUG=all
+enables libblkid debug output.
+.IP LIBSMARTCOLS_DEBUG=all
+enables libsmartcols debug output.
+.IP LIBSMARTCOLS_DEBUG_PADDING=on
+use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
 
 .SH "SEE ALSO"
 .BR cfdisk (8),
-.BR sfdisk (8),
 .BR mkfs (8),
-.BR partx (8)
+.BR partx (8),
+.BR sfdisk (8)
 
 .SH AVAILABILITY
 The fdisk command is part of the util-linux package and is available from