]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/fdisk.8
wipefs: add --lock and LOCK_BLOCK_DEVICE
[thirdparty/util-linux.git] / disk-utils / fdisk.8
index cdb3168238e5325dfeb25687425237a6ae4957f9..bb6e0588b6b6f8ad5ec7a49576b965223ce6eb99 100644 (file)
@@ -32,10 +32,14 @@ All partitioning is driven by device I/O limits (the topology) by default.
 .B fdisk
 is able to optimize the disk layout for a 4K-sector size and use an alignment offset on
 modern devices for MBR and GPT.  It is always a good idea to follow \fBfdisk\fR's defaults
-as the default values (e.g. first and last partition sectors) and partition
-sizes specified by the +<size>{M,G,...} notation are always aligned according
+as the default values (e.g., first and last partition sectors) and partition
+sizes specified by the +/-<size>{M,G,...} notation are always aligned according
 to the device properties.
 
+CHS (Cylinder-Head-Sector) addressing is deprecated and not used by default.
+Please, do not follow old articles and recommendations with "fdisk \-S <n> \-H
+<n>" advices for SSD or 4K-sector devices.
+
 Note that
 .BR partx (8)
 provides a rich interface for scripts to print disk layouts,
@@ -54,15 +58,15 @@ between logical and physical sector size.  This option changes both sector sizes
 .IB sectorsize .
 .TP
 \fB\-B\fR, \fB\-\-protect\-boot\fP
-Don't erase the begin of the first disk sector when create a new disk label.  This
+Don't erase the beginning of the first disk sector when creating 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'.
+\fImode\fR argument cannot be separated from the \fB\-c\fR option by a space,
+the correct form is for example '\-c=dos'.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
 Display a help text and exit.
@@ -79,18 +83,25 @@ If no devices are given, those mentioned in
 .I /proc/partitions
 (if that file exists) are used.
 .TP
+\fB\-x\fR, \fB\-\-list\-details\fR
+Like \fB\-\-list\fR, but provides more details.
+.TP
+\fB\-n\fR, \fB\-\-noauto\-pt\fR
+Don't automatically create a default partition table on empty device.  The partition table
+has to be explicitly created by user (by command like 'o', 'g', etc.).
+.TP
 .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).
+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).
+.BR blockdev (8).
 .TP
 \fB\-t\fR, \fB\-\-type\fR \fItype\fR
 Enable support only for disklabels of the specified \fItype\fP, and disable
@@ -100,8 +111,8 @@ support for all other types.
 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'.
+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
@@ -157,20 +168,23 @@ The
 .I partition
 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).
+documentation (the Documentation/admin-guide/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. 
+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". 
+partition first sector.  If the size is prefixed by  '\-' then it is interpreted
+as relative to the high limit (last available sector for the partition).
+
+In the case the size is specified in bytes than 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.
++/-<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
@@ -259,11 +273,11 @@ Linux.
 A sync() and an ioctl(BLKRRPART) (rereading the partition table from disk)
 are performed before exiting when the partition table has been updated.
 
-.SH "DOS mode and DOS 6.x WARNING"
+.SH DOS mode and DOS 6.x WARNING
 .B Note that all this is deprecated.  You don't have to care about things like
 .B geometry and cylinders on modern operating systems.  If you really want
 .B DOS-compatible partitioning then you have to enable DOS mode and cylinder
-.B units by using the '-c=dos -u=cylinders' fdisk command-line options.
+.B units by using the '\-c=dos \-u=cylinders' fdisk command-line options.
 
 The DOS 6.x FORMAT command looks for some information in the first sector of
 the data area of the partition, and treats this information as more reliable
@@ -332,6 +346,18 @@ The warning messages.
 .B welcome
 The welcome message.
 
+.SH ENVIRONMENT
+.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 AUTHORS
 .MT kzak@redhat.com
 Karel Zak
@@ -345,19 +371,7 @@ Davidlohr Bueso
 The original version was written by
 Andries E. Brouwer, A. V. Le Blanc and others.
 
-.SH ENVIRONMENT
-.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"
+.SH SEE ALSO
 .BR cfdisk (8),
 .BR mkfs (8),
 .BR partx (8),
@@ -365,4 +379,4 @@ use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
 
 .SH AVAILABILITY
 The fdisk command is part of the util-linux package and is available from
-ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
+https://www.kernel.org/pub/linux/utils/util-linux/.