summaryrefslogtreecommitdiffstats
path: root/disk-utils/sfdisk.8
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
commit378c18e5f024ac5a8aef4cb40d7c9aa9633d144c (patch)
tree44dfb6ca500d32cabd450649b322a42e70a30683 /disk-utils/sfdisk.8
parentInitial commit. (diff)
downloadutil-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.tar.xz
util-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.zip
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--disk-utils/sfdisk.8681
-rw-r--r--disk-utils/sfdisk.8.adoc461
2 files changed, 1142 insertions, 0 deletions
diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8
new file mode 100644
index 0000000..646d118
--- /dev/null
+++ b/disk-utils/sfdisk.8
@@ -0,0 +1,681 @@
+'\" t
+.\" Title: sfdisk
+.\" Author: [see the "AUTHOR(S)" section]
+.\" Generator: Asciidoctor 2.0.15
+.\" Date: 2022-08-04
+.\" Manual: System Administration
+.\" Source: util-linux 2.38.1
+.\" Language: English
+.\"
+.TH "SFDISK" "8" "2022-08-04" "util\-linux 2.38.1" "System Administration"
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.ss \n[.ss] 0
+.nh
+.ad l
+.de URL
+\fI\\$2\fP <\\$1>\\$3
+..
+.als MTO URL
+.if \n[.g] \{\
+. mso www.tmac
+. am URL
+. ad l
+. .
+. am MTO
+. ad l
+. .
+. LINKSTYLE blue R < >
+.\}
+.SH "NAME"
+sfdisk \- display or manipulate a disk partition table
+.SH "SYNOPSIS"
+.sp
+\fBsfdisk\fP [options] \fIdevice\fP [\fB\-N\fP \fIpartition\-number\fP]
+.sp
+\fBsfdisk\fP [options] \fIcommand\fP
+.SH "DESCRIPTION"
+.sp
+\fBsfdisk\fP is a script\-oriented tool for partitioning any block device. It runs in interactive mode if executed on a terminal (stdin refers to a terminal).
+.sp
+Since version 2.26 \fBsfdisk\fP supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder\-Head\-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
+.sp
+\fBsfdisk\fP protects the first disk sector when create a new disk label. The option \fB\-\-wipe always\fP disables this protection. Note that \fBfdisk\fP(8) and \fBcfdisk\fP(8) completely erase this area by default.
+.sp
+\fBsfdisk\fP (since version 2.26) \fBaligns the start and end of partitions\fP to block\-device I/O limits when relative sizes are specified, when the default values are used or when multiplicative suffixes (e.g., MiB) are used for sizes. It is possible that partition size will be optimized (reduced or enlarged) due to alignment if the start offset is specified exactly in sectors and partition size relative or by multiplicative suffixes.
+.sp
+The recommended way is not to specify start offsets at all and specify partition size in MiB, GiB (or so). In this case \fBsfdisk\fP aligns all partitions to block\-device I/O limits (or when I/O limits are too small then to megabyte boundary to keep disk layout portable). If this default behaviour is unwanted (usually for very small partitions) then specify offsets and sizes in sectors. In this case \fBsfdisk\fP entirely follows specified numbers without any optimization.
+.sp
+\fBsfdisk\fP does not create the standard system partitions for SGI and SUN disk labels like \fBfdisk\fP(8) does. It is necessary to explicitly create all partitions including whole\-disk system partitions.
+.sp
+\fBsfdisk\fP uses \fBBLKRRPART\fP (reread partition table) ioctl to make sure that the device is not used by system or other tools (see also \fB\-\-no\-reread\fP). It\(cqs possible that this feature or another \fBsfdisk\fP activity races with \fBsystemd\-udevd\fP(8). The recommended way how to avoid possible collisions is to use \fB\-\-lock\fP option. The exclusive lock will cause \fBsystemd\-udevd\fP to skip the event handling on the device.
+.sp
+The \fBsfdisk\fP prompt is only a hint for users and a displayed partition number does not mean that the same partition table entry will be created (if \fB\-N\fP not specified), especially for tables with gaps.
+.SH "COMMANDS"
+.sp
+The commands are mutually exclusive.
+.sp
+[\fB\-N\fP \fIpartition\-number\fP] \fIdevice\fP
+.RS 4
+The default \fBsfdisk\fP command is to read the specification for the desired partitioning of \fIdevice\fP from standard input, and then create a partition table according to the specification. See below for the description of the input format. If standard input is a terminal, then \fBsfdisk\fP starts an interactive session.
+.sp
+If the option \fB\-N\fP is specified, then the changes are applied to the partition addressed by \fIpartition\-number\fP. The unspecified fields of the partition are not modified.
+.sp
+Note that it\(cqs possible to address an unused partition with \fB\-N\fP. For example, an MBR always contains 4 partitions, but the number of used partitions may be smaller. In this case \fBsfdisk\fP follows the default values from the partition table and does not use built\-in defaults for the unused partition given with \fB\-N\fP. See also \fB\-\-append\fP.
+.RE
+.sp
+\fB\-A\fP, \fB\-\-activate\fP \fIdevice\fP [\fIpartition\-number\fP...]
+.RS 4
+Switch on the bootable flag for the specified partitions and switch off the bootable flag on all unspecified partitions. The special placeholder \(aq\-\(aq may be used instead of the partition numbers to switch off the bootable flag on all partitions.
+.sp
+The activation command is supported for MBR and PMBR only. If a GPT label is detected, then \fBsfdisk\fP prints warning and automatically enters PMBR.
+.sp
+If no \fIpartition\-number\fP is specified, then list the partitions with an enabled flag.
+.RE
+.sp
+\fB\-\-backup\-pt\-sectors\fP \fIdevice\fP
+.RS 4
+Back up the current partition table sectors in binary format and exit. See the \fBBACKING UP THE PARTITION TABLE\fP section.
+.RE
+.sp
+\fB\-\-delete\fP \fIdevice\fP [\fIpartition\-number\fP...]
+.RS 4
+Delete all or the specified partitions.
+.RE
+.sp
+\fB\-d\fP, \fB\-\-dump\fP \fIdevice\fP
+.RS 4
+Dump the partitions of a device in a format that is usable as input to \fBsfdisk\fP. See the \fBBACKING UP THE PARTITION TABLE\fP section.
+.RE
+.sp
+\fB\-g\fP, \fB\-\-show\-geometry\fP [\fIdevice\fP...]
+.RS 4
+List the geometry of all or the specified devices. For backward compatibility the deprecated option \fB\-\-show\-pt\-geometry\fP have the same meaning as this one.
+.RE
+.sp
+\fB\-J\fP, \fB\-\-json\fP \fIdevice\fP
+.RS 4
+Dump the partitions of a device in JSON format. Note that \fBsfdisk\fP is not able to use JSON as input format.
+.RE
+.sp
+\fB\-l\fP, \fB\-\-list\fP [\fIdevice\fP...]
+.RS 4
+List the partitions of all or the specified devices. This command can be used together with \fB\-\-verify\fP.
+.RE
+.sp
+\fB\-F\fP, \fB\-\-list\-free\fP [\fIdevice\fP...]
+.RS 4
+List the free unpartitioned areas on all or the specified devices.
+.RE
+.sp
+\fB\-\-part\-attrs\fP \fIdevice partition\-number\fP [\fIattributes\fP]
+.RS 4
+Change the GPT partition attribute bits. If \fIattributes\fP is not specified, then print the current partition settings. The \fIattributes\fP argument is a comma\- or space\-delimited list of bits numbers or bit names. For example, the string "RequiredPartition,50,51" sets three bits. The currently supported attribute bits are:
+.sp
+\fBBit 0 (RequiredPartition)\fP
+.RS 4
+If this bit is set, the partition is required for the platform to function. The creator of the partition indicates that deletion or modification of the contents can result in loss of platform features or failure for the platform to boot or operate. The system cannot function normally if this partition is removed, and it should be considered part of the hardware of the system.
+.RE
+.sp
+\fBBit 1 (NoBlockIOProtocol)\fP
+.RS 4
+EFI firmware should ignore the content of the partition and not try to read from it.
+.RE
+.sp
+\fBBit 2 (LegacyBIOSBootable)\fP
+.RS 4
+The partition may be bootable by legacy BIOS firmware.
+.RE
+.sp
+\fBBits 3\-47\fP
+.RS 4
+Undefined and must be zero. Reserved for expansion by future versions of the UEFI specification.
+.RE
+.sp
+\fBBits 48\-63\fP
+.RS 4
+Reserved for GUID specific use. The use of these bits will vary depending on the partition type. For example Microsoft uses bit 60 to indicate read\-only, 61 for shadow copy of another partition, 62 for hidden partitions and 63 to disable automount.
+.RE
+.RE
+.sp
+\fB\-\-part\-label\fP \fIdevice partition\-number\fP [\fIlabel\fP]
+.RS 4
+Change the GPT partition name (label). If \fIlabel\fP is not specified, then print the current partition label.
+.RE
+.sp
+\fB\-\-part\-type\fP \fIdevice partition\-number\fP [\fItype\fP]
+.RS 4
+Change the partition type. If \fItype\fP is not specified, then print the current partition type.
+.sp
+The \fItype\fP argument is hexadecimal for MBR, GUID for GPT, type alias (e.g. "linux") or type shortcut (e.g. \(aqL\(aq). For backward compatibility the options \fB\-c\fP and \fB\-\-id\fP have the same meaning as this one.
+.RE
+.sp
+\fB\-\-part\-uuid\fP \fIdevice partition\-number\fP [\fIuuid\fP]
+.RS 4
+Change the GPT partition UUID. If \fIuuid\fP is not specified, then print the current partition UUID.
+.RE
+.sp
+\fB\-\-disk\-id\fP \fIdevice\fP [\fIid\fP]
+.RS 4
+Change the disk identifier. If \fIid\fP is not specified, then print the current identifier. The identifier is UUID for GPT or unsigned integer for MBR.
+.RE
+.sp
+\fB\-r\fP, \fB\-\-reorder\fP \fIdevice\fP
+.RS 4
+Renumber the partitions, ordering them by their start offset.
+.RE
+.sp
+\fB\-s\fP, \fB\-\-show\-size\fP [\fIdevice\fP...]
+.RS 4
+List the sizes of all or the specified devices in units of 1024 byte size. This command is DEPRECATED in favour of \fBblockdev\fP(8).
+.RE
+.sp
+\fB\-T\fP, \fB\-\-list\-types\fP
+.RS 4
+Print all supported types for the current disk label or the label specified by \fB\-\-label\fP.
+.RE
+.sp
+\fB\-V\fP, \fB\-\-verify\fP [\fIdevice\fP...]
+.RS 4
+Test whether the partition table and partitions seem correct.
+.RE
+.sp
+\fB\-\-relocate\fP \fIoper\fP \fIdevice\fP
+.RS 4
+Relocate partition table header. This command is currently supported for GPT header only. The argument \fIoper\fP can be:
+.sp
+\fBgpt\-bak\-std\fP
+.RS 4
+Move GPT backup header to the standard location at the end of the device.
+.RE
+.sp
+\fBgpt\-bak\-mini\fP
+.RS 4
+Move GPT backup header behind the last partition. Note that UEFI standard requires the backup header at the end of the device and partitioning tools can automatically relocate the header to follow the standard.
+.RE
+.RE
+.SH "OPTIONS"
+.sp
+\fB\-a\fP, \fB\-\-append\fP
+.RS 4
+Don\(cqt create a new partition table, but only append the specified partitions.
+.sp
+Note that unused partition maybe be re\-used in this case although it is not the last partition in the partition table. See also \fB\-N\fP to specify entry in the partition table.
+.RE
+.sp
+\fB\-b\fP, \fB\-\-backup\fP
+.RS 4
+Back up the current partition table sectors before starting the partitioning. The default backup file name is \fI~/sfdisk\-<device>\-<offset>.bak\fP; to use another name see option \fB\-O\fP, \fB\-\-backup\-file\fP. See section \fBBACKING UP THE PARTITION TABLE\fP for more details.
+.RE
+.sp
+\fB\-\-color\fP[\fB=\fP\fIwhen\fP]
+.RS 4
+Colorize the output. The optional argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. If the \fIwhen\fP argument is omitted, it defaults to \fBauto\fP. The colors can be disabled; for the current built\-in default see the \fB\-\-help\fP output. See also the \fBCOLORS\fP section.
+.RE
+.sp
+\fB\-f\fP, \fB\-\-force\fP
+.RS 4
+Disable all consistency checking.
+.RE
+.sp
+\fB\-\-Linux\fP
+.RS 4
+Deprecated and ignored option. Partitioning that is compatible with Linux (and other modern operating systems) is the default.
+.RE
+.sp
+\fB\-\-lock\fP[=\fImode\fP]
+.RS 4
+Use exclusive BSD lock for device or file it operates. The optional argument \fImode\fP can be \fByes\fP, \fBno\fP (or 1 and 0) or \fBnonblock\fP. If the \fImode\fP argument is omitted, it defaults to \fByes\fP. This option overwrites environment variable \fB$LOCK_BLOCK_DEVICE\fP. The default is not to use any lock at all, but it\(cqs recommended to avoid collisions with \fBsystemd\-udevd\fP(8) or other tools.
+.RE
+.sp
+\fB\-n\fP, \fB\-\-no\-act\fP
+.RS 4
+Do everything except writing to the device.
+.RE
+.sp
+\fB\-\-no\-reread\fP
+.RS 4
+Do not check through the re\-read\-partition\-table ioctl whether the device is in use.
+.RE
+.sp
+\fB\-\-no\-tell\-kernel\fP
+.RS 4
+Don\(cqt tell the kernel about partition changes. This option is recommended together with \fB\-\-no\-reread\fP to modify a partition on used disk. The modified partition should not be used (e.g., mounted).
+.RE
+.sp
+\fB\-O\fP, \fB\-\-backup\-file\fP \fIpath\fP
+.RS 4
+Override the default backup file name. Note that the device name and offset are always appended to the file name.
+.RE
+.sp
+\fB\-\-move\-data\fP[\fB=\fP\fIpath\fP]
+.RS 4
+Move data after partition relocation, for example when moving the beginning of a partition to another place on the disk. The size of the partition has to remain the same, the new and old location may overlap. This option requires option \fB\-N\fP in order to be processed on one specific partition only.
+.sp
+The optional \fIpath\fP specifies log file name. The log file contains information about all read/write operations on the partition data. The word "@default" as a \fIpath\fP forces \fBsfdisk\fP to use \fI~/sfdisk\-<devname>.move\fP for the log. The log is optional since v2.35.
+.sp
+Note that this operation is risky and not atomic. \fBDon\(cqt forget to backup your data!\fP
+.sp
+See also \fB\-\-move\-use\-fsync\fP.
+.sp
+In the example below, the first command creates a 100MiB free area before the first partition and moves the data it contains (e.g., a filesystem), the next command creates a new partition from the free space (at offset 2048), and the last command reorders partitions to match disk order (the original sdc1 will become sdc2).
+.sp
+\fBecho \(aq+100M,\(aq | sfdisk \-\-move\-data /dev/sdc \-N 1\fP \fBecho \(aq2048,\(aq | sfdisk /dev/sdc \-\-append\fP \fBsfdisk /dev/sdc \-\-reorder\fP
+.RE
+.sp
+\fB\-\-move\-use\-fsync\fP
+.RS 4
+Use the \fBfsync\fP(2) system call after each write when moving data to a new location by \fB\-\-move\-data\fP.
+.RE
+.sp
+\fB\-o\fP, \fB\-\-output\fP \fIlist\fP
+.RS 4
+Specify which output columns to print. Use \fB\-\-help\fP to get a list of all supported columns.
+.sp
+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).
+.RE
+.sp
+\fB\-q\fP, \fB\-\-quiet\fP
+.RS 4
+Suppress extra info messages.
+.RE
+.sp
+\fB\-u\fP, \fB\-\-unit S\fP
+.RS 4
+Deprecated option. Only the sector unit is supported. This option is not supported when using the \fB\-\-show\-size\fP command.
+.RE
+.sp
+\fB\-X\fP, \fB\-\-label\fP \fItype\fP
+.RS 4
+Specify the disk label type (e.g., \fBdos\fP, \fBgpt\fP, ...). If this option is not given, then \fBsfdisk\fP defaults to the existing label, but if there is no label on the device yet, then the type defaults to \fBdos\fP. The default or the current label may be overwritten by the "label: <name>" script header line. The option \fB\-\-label\fP does not force \fBsfdisk\fP to create empty disk label (see the \fBEMPTY DISK LABEL\fP section below).
+.RE
+.sp
+\fB\-Y\fP, \fB\-\-label\-nested\fP \fItype\fP
+.RS 4
+Force editing of a nested disk label. The primary disk label has to exist already. This option allows editing for example a hybrid/protective MBR on devices with GPT.
+.RE
+.sp
+\fB\-w\fP, \fB\-\-wipe\fP \fIwhen\fP
+.RS 4
+Wipe filesystem, RAID and partition\-table signatures from the device, in order to avoid possible collisions. The argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. When this option is not given, the default is \fBauto\fP, in which case signatures are wiped only when in interactive mode; except the old partition\-table signatures which are always wiped before create a new partition\-table if the argument \fIwhen\fP is not \fBnever\fP. The \fBauto\fP mode also does not wipe the first sector (boot sector), it is necessary to use the \fBalways\fP mode to wipe this area. In all cases detected signatures are reported by warning messages before a new partition table is created. See also the \fBwipefs\fP(8) command.
+.RE
+.sp
+\fB\-W\fP, \fB\-\-wipe\-partitions\fP \fIwhen\fP
+.RS 4
+Wipe filesystem, RAID and partition\-table signatures from a newly created partition, in order to avoid possible collisions. The argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. When this option is not given, the default is \fBauto\fP, 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 after a new partition is created. See also \fBwipefs\fP(8) command.
+.RE
+.sp
+\fB\-v\fP, \fB\-\-version\fP
+.RS 4
+Display version information and exit.
+.RE
+.sp
+\fB\-h\fP, \fB\-\-help\fP
+.RS 4
+Display help text and exit.
+.RE
+.SH "INPUT FORMATS"
+.sp
+\fBsfdisk\fP supports two input formats and generic header lines.
+.SS "Header lines"
+.sp
+The optional header lines specify generic information that apply to the partition table. The header\-line format is:
+.sp
+\fB<name>: <value>\fP
+.sp
+The currently recognized headers are:
+.sp
+\fBunit\fP
+.RS 4
+Specify the partitioning unit. The only supported unit is \fBsectors\fP.
+.RE
+.sp
+\fBlabel\fP
+.RS 4
+Specify the partition table type. For example \fBdos\fP or \fBgpt\fP.
+.RE
+.sp
+\fBlabel\-id\fP
+.RS 4
+Specify the partition table identifier. It should be a hexadecimal number (with a 0x prefix) for MBR and a UUID for GPT.
+.RE
+.sp
+\fBfirst\-lba\fP
+.RS 4
+Specify the first usable sector for GPT partitions.
+.RE
+.sp
+\fBlast\-lba\fP
+.RS 4
+Specify the last usable sector for GPT partitions.
+.RE
+.sp
+\fBtable\-length\fP
+.RS 4
+Specify the maximal number of GPT partitions.
+.RE
+.sp
+\fBgrain\fP
+.RS 4
+Specify minimal size in bytes used to calculate partitions alignment. The default is 1MiB and it\(cqs strongly recommended to use the default. Do not modify this variable if you\(cqre not sure.
+.RE
+.sp
+\fBsector\-size\fP
+.RS 4
+Specify sector size. This header is informative only and it is not used when \fBsfdisk\fP creates a new partition table, in this case the real device specific value is always used and sector size from the dump is ignored.
+.RE
+.sp
+Note that it is only possible to use header lines before the first partition is specified in the input.
+.SS "Unnamed\-fields format"
+.RS 3
+.ll -.6i
+.sp
+\fIstart size type bootable\fP
+.br
+.RE
+.ll
+.sp
+where each line fills one partition descriptor.
+.sp
+Fields are separated by whitespace, comma (recommended) or semicolon possibly followed by whitespace; initial and trailing whitespace is ignored. Numbers can be octal, decimal or hexadecimal; decimal is the default. When a field is absent, empty or specified as \(aq\-\(aq a default value is used. But when the \fB\-N\fP option (change a single partition) is given, the default for each field is its previous value.
+.sp
+The default value of \fIstart\fP is the first non\-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes. Since v2.38 when the \fB\-N\fP option (change a single partition) is given, a \(aq+\(aq can be used to enlarge partition by move start of the partition if there is a free space before the partition.
+.sp
+The default value of \fIsize\fP indicates "as much as possible"; i.e., until the next partition or end\-of\-device. A numerical argument is by default interpreted as a number of sectors, however if the size is followed by one of the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as the size of the partition in bytes and it is then aligned according to the device I/O limits. A \(aq+\(aq can be used instead of a number to enlarge the partition as much as possible. Note \(aq+\(aq is equivalent to the default behaviour for a new partition; existing partitions will be resized as required.
+.sp
+The partition \fItype\fP is given in hex for MBR (DOS) where 0x prefix is optional; a GUID string for GPT; a shortcut or an alias. It\(cqs recommended to use two letters for MBR hex codes to avoid collision between deprecated shortcut \(aqE\(aq and \(aq0E\(aq MBR hex code. For backward compatibility \fBsfdisk\fP tries to interpret \fItype\fP as a shortcut as a first possibility in partitioning scripts although on other places (e.g. \fB\-\-part\-type\fP command) it tries shortcuts as the last possibility.
+.sp
+Since v2.36 libfdisk supports partition type aliases as extension to shortcuts. The alias is a simple human readable word (e.g. "linux").
+.sp
+Since v2.37 libfdisk supports partition type names on input, ignoring the case of the characters and all non\-alphanumeric and non\-digit characters in the name (e.g. "Linux /usr x86" is the same as "linux usr\-x86").
+.sp
+Supported shortcuts and aliases:
+.sp
+\fBL \- alias \(aqlinux\(aq\fP
+.RS 4
+Linux; means 83 for MBR and 0FC63DAF\-8483\-4772\-8E79\-3D69D8477DE4 for GPT.
+.RE
+.sp
+\fBS \- alias \(aqswap\(aq\fP
+.RS 4
+swap area; means 82 for MBR and 0657FD6D\-A4AB\-43C4\-84E5\-0933C84B4F4F for GPT
+.RE
+.sp
+\fBEx \- alias \(aqextended\(aq\fP
+.RS 4
+MBR extended partition; means 05 for MBR. The original shortcut \(aqE\(aq is deprecated due to collision with 0x0E MBR partition type.
+.RE
+.sp
+\fBH \- alias \(aqhome\(aq\fP
+.RS 4
+home partition; means 933AC7E1\-2EB4\-4F13\-B844\-0E14E2AEF915 for GPT
+.RE
+.sp
+\fBU \- alias \(aquefi\(aq\fP
+.RS 4
+EFI System partition, means EF for MBR and C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B for GPT
+.RE
+.sp
+\fBR \- alias \(aqraid\(aq\fP
+.RS 4
+Linux RAID; means FD for MBR and A19D880F\-05FC\-4D3B\-A006\-743F0F84911E for GPT
+.RE
+.sp
+\fBV \- alias \(aqlvm\(aq\fP
+.RS 4
+LVM; means 8E for MBR and E6D6D379\-F507\-44C2\-A23C\-238F2A3DF928 for GPT
+.RE
+.sp
+The default \fItype\fP value is \fIlinux\fP.
+.sp
+The shortcut \(aqX\(aq for Linux extended partition (85) is deprecated in favour of \(aqEx\(aq.
+.sp
+\fIbootable\fP is specified as [\fB*\fP|\fB\-\fP], with as default not\-bootable. The value of this field is irrelevant for Linux \- when Linux runs it has been booted already \- but it might play a role for certain boot loaders and for other operating systems.
+.SS "Named\-fields format"
+.sp
+This format is more readable, robust, extensible and allows specifying additional information (e.g., a UUID). It is recommended to use this format to keep your scripts more readable.
+.RS 3
+.ll -.6i
+.sp
+[\fIdevice\fP \fB:\fP] \fIname\fP[\fB=\fP\fIvalue\fP], ...
+.br
+.RE
+.ll
+.sp
+The \fIdevice\fP field is optional. \fBsfdisk\fP extracts the partition number from the device name. It allows specifying the partitions in random order. This functionality is mostly used by \fB\-\-dump\fP. Don\(cqt use it if you are not sure.
+.sp
+The \fIvalue\fP can be between quotation marks (e.g., name="This is partition name"). The fields \fBstart=\fP and \fBsize=\fP support \(aq+\(aq and \(aq\-\(aq in the same way as \fBUnnamed\-fields format\fP.
+.sp
+The currently supported fields are:
+.sp
+\fBstart=\fP\fInumber\fP
+.RS 4
+The first non\-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes.
+.RE
+.sp
+\fBsize=\fP\fInumber\fP
+.RS 4
+Specify the partition size in sectors. The number may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it\(cqs interpreted as size in bytes and the size is aligned according to device I/O limits.
+.RE
+.sp
+\fBbootable\fP
+.RS 4
+Mark the partition as bootable.
+.RE
+.sp
+\fBattrs=\fP\fIstring\fP
+.RS 4
+Partition attributes, usually GPT partition attribute bits. See \fB\-\-part\-attrs\fP for more details about the GPT\-bits string format.
+.RE
+.sp
+\fBuuid=\fP\fIstring\fP
+.RS 4
+GPT partition UUID.
+.RE
+.sp
+\fBname=\fP\fIstring\fP
+.RS 4
+GPT partition name.
+.RE
+.sp
+\fBtype=\fP\fIcode\fP
+.RS 4
+A hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition, a shortcut as for unnamed\-fields format or a type name (e.g. type="Linux /usr (x86)"). See above the section about the unnamed\-fields format for more details. For backward compatibility the \fBId=\fP field has the same meaning.
+.RE
+.SH "EMPTY DISK LABEL"
+.sp
+\fBsfdisk\fP does not create partition table without partitions by default. The lines with partitions are expected in the script by default. The empty partition table has to be explicitly requested by "label: <name>" script header line without any partitions lines. For example:
+.RS 3
+.ll -.6i
+.sp
+\fBecho \(aqlabel: gpt\(aq | sfdisk /dev/sdb\fP
+.br
+.RE
+.ll
+.sp
+creates empty GPT partition table. Note that the \fB\-\-append\fP disables this feature.
+.SH "BACKING UP THE PARTITION TABLE"
+.sp
+It is recommended to save the layout of your devices. \fBsfdisk\fP supports two ways.
+.SS "Dump in sfdisk compatible format"
+.sp
+Use the \fB\-\-dump\fP command to save a description of the device layout to a text file.
+The dump format is suitable for later \fBsfdisk\fP input. For example:
+.RS 3
+.ll -.6i
+.sp
+\fBsfdisk \-\-dump /dev/sda > sda.dump\fP
+.br
+.RE
+.ll
+.sp
+This can later be restored by:
+.RS 3
+.ll -.6i
+.sp
+\fBsfdisk /dev/sda < sda.dump\fP
+.br
+.RE
+.ll
+.SS "Full binary backup"
+.sp
+If you want to do a full binary backup of all sectors where the partition table is stored, then use the \fB\-\-backup\-pt\-sectors\fP command. It writes the sectors to \fI~/sfdisk\-<device>\-<offset>.bak\fP files. The default name of the backup file can be changed with the \fB\-\-backup\-file\fP option. The backup files contain only raw data from the \fIdevice\fP. For example:
+.RS 3
+.ll -.6i
+.sp
+\fBsfdisk \-\-backup\-pt\-sectors /dev/sda\fP
+.br
+.RE
+.ll
+.sp
+The GPT header can later be restored by:
+.RS 3
+.ll -.6i
+.sp
+\fBdd if=~/sfdisk\-sda\-0x00000200.bak of=/dev/sda seek=$((0x00000200)) bs=1 conv=notrunc\fP
+.br
+.RE
+.ll
+.sp
+It\(cqs also possible to use the \fB\-\-backup\fP option to create the same backup immediately after startup for other \fBsfdisk\fP commands. For example, backup partition table before deleting all partitions from partition table:
+.RS 3
+.ll -.6i
+.sp
+\fBsfdisk \-\-backup \-\-delete /dev/sda\fP
+.br
+.RE
+.ll
+.sp
+The same concept of backup files is used by \fBwipefs\fP(8).
+.sp
+Note that \fBsfdisk\fP since version 2.26 no longer provides the \fB\-I\fP option to restore sectors. \fBdd\fP(1) provides all necessary functionality.
+.SH "COLORS"
+.sp
+The output colorization is implemented by \fBterminal\-colors.d\fP(5) functionality.
+Implicit coloring can be disabled by an empty file
+.RS 3
+.ll -.6i
+.sp
+\fI/etc/terminal\-colors.d/sfdisk.disable\fP
+.br
+.RE
+.ll
+.sp
+for the \fBsfdisk\fP command or for all tools by
+.RS 3
+.ll -.6i
+.sp
+\fI/etc/terminal\-colors.d/disable\fP
+.br
+.RE
+.ll
+.sp
+The user\-specific \fI$XDG_CONFIG_HOME/terminal\-colors.d\fP
+or \fI$HOME/.config/terminal\-colors.d\fP overrides the global setting.
+.sp
+Note that the output colorization may be enabled by default, and in this case
+\fIterminal\-colors.d\fP directories do not have to exist yet.
+.sp
+The logical color names supported by \fBsfdisk\fP are:
+.sp
+\fBheader\fP
+.RS 4
+The header of the output tables.
+.RE
+.sp
+\fBwarn\fP
+.RS 4
+The warning messages.
+.RE
+.sp
+\fBwelcome\fP
+.RS 4
+The welcome message.
+.RE
+.SH "ENVIRONMENT"
+.sp
+\fBSFDISK_DEBUG\fP=all
+.RS 4
+enables \fBsfdisk\fP debug output.
+.RE
+.sp
+\fBLIBFDISK_DEBUG\fP=all
+.RS 4
+enables libfdisk debug output.
+.RE
+.sp
+\fBLIBBLKID_DEBUG\fP=all
+.RS 4
+enables libblkid debug output.
+.RE
+.sp
+\fBLIBSMARTCOLS_DEBUG\fP=all
+.RS 4
+enables libsmartcols debug output.
+.RE
+.sp
+\fBLOCK_BLOCK_DEVICE\fP=<mode>
+.RS 4
+use exclusive BSD lock. The mode is "1" or "0". See \fB\-\-lock\fP for more details.
+.RE
+.SH "NOTES"
+.sp
+Since version 2.26 \fBsfdisk\fP no longer provides the \fB\-R\fP or \fB\-\-re\-read\fP option to force the kernel to reread the partition table. Use \fBblockdev \-\-rereadpt\fP instead.
+.sp
+Since version 2.26 \fBsfdisk\fP does not provide the \fB\-\-DOS\fP, \fB\-\-IBM\fP, \fB\-\-DOS\-extended\fP, \fB\-\-unhide\fP, \fB\-\-show\-extended\fP, \fB\-\-cylinders\fP, \fB\-\-heads\fP, \fB\-\-sectors\fP, \fB\-\-inside\-outer\fP, \fB\-\-not\-inside\-outer\fP options.
+.SH "EXAMPLES"
+.sp
+\fBsfdisk \-\-list \-\-label\-nested=mbr /dev/sda\fP
+.RS 4
+Print protective MBR on device with GPT disk label.
+.RE
+.sp
+\fBecho \-e \(aq,10M,L\(rsn,10M,L\(rsn,+,\(rsn\(aq | sfdisk /dev/sdc\fP
+.RS 4
+Create three Linux partitions, with the default start, the size of the first two partitions is 10MiB, and the last partition fills all available space on the device.
+.RE
+.sp
+\fBecho \-e \(aqsize=10M, type=L\(rsn size=10M, type=L\(rsn size=+\(rsn\(aq | sfdisk /dev/sdc\fP
+.RS 4
+The same as the previous example, but in named\-fields format.
+.RE
+.sp
+\fBecho \-e \(aqtype=swap\(aq | sfdisk \-N 3 /dev/sdc\fP
+.RS 4
+Set type of the 3rd partition to \(aqswap\(aq.
+.RE
+.sp
+\fBsfdisk \-\-part\-type /dev/sdc 3 swap\fP
+.RS 4
+The same as the previous example, but without script use.
+.RE
+.sp
+\fBsfdisk \-\-delete /dev/sdc 2\fP
+.RS 4
+Delete 2nd partition.
+.RE
+.sp
+\fBecho "," | sfdisk \-N 3 \-\-move\-data /dev/sdc\fP
+.RS 4
+Enlarge 3rd partition in both directions, move start to use free space before the partition and enlarge the size to use all free space after to the partition, and move partition data too.
+.RE
+.SH "AUTHORS"
+.sp
+.MTO "kzak\(atredhat.com" "Karel Zak" ""
+.sp
+The current \fBsfdisk\fP implementation is based on the original \fBsfdisk\fP from Andries E. Brouwer.
+.SH "SEE ALSO"
+.sp
+\fBfdisk\fP(8),
+\fBcfdisk\fP(8),
+\fBparted\fP(8),
+\fBpartprobe\fP(8),
+\fBpartx\fP(8)
+.SH "REPORTING BUGS"
+.sp
+For bug reports, use the issue tracker at \c
+.URL "https://github.com/util\-linux/util\-linux/issues" "" "."
+.SH "AVAILABILITY"
+.sp
+The \fBsfdisk\fP command is part of the util\-linux package which can be downloaded from \c
+.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "." \ No newline at end of file
diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc
new file mode 100644
index 0000000..7f0a37e
--- /dev/null
+++ b/disk-utils/sfdisk.8.adoc
@@ -0,0 +1,461 @@
+//po4a: entry man manual
+////
+sfdisk.8 -- man page for sfdisk
+Copyright (C) 2014 Karel Zak <kzak@redhat.com>
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the
+entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+////
+= sfdisk(8)
+:doctype: manpage
+:man manual: System Administration
+:man source: util-linux {release-version}
+:page-layout: base
+:command: sfdisk
+:plus: +
+:asterisk: *
+
+== NAME
+
+sfdisk - display or manipulate a disk partition table
+
+== SYNOPSIS
+
+*sfdisk* [options] _device_ [*-N* _partition-number_]
+
+*sfdisk* [options] _command_
+
+== DESCRIPTION
+
+*sfdisk* is a script-oriented tool for partitioning any block device. It runs in interactive mode if executed on a terminal (stdin refers to a terminal).
+
+Since version 2.26 *sfdisk* supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
+
+*sfdisk* protects the first disk sector when create a new disk label. The option *--wipe always* disables this protection. Note that *fdisk*(8) and *cfdisk*(8) completely erase this area by default.
+
+*sfdisk* (since version 2.26) *aligns the start and end of partitions* to block-device I/O limits when relative sizes are specified, when the default values are used or when multiplicative suffixes (e.g., MiB) are used for sizes. It is possible that partition size will be optimized (reduced or enlarged) due to alignment if the start offset is specified exactly in sectors and partition size relative or by multiplicative suffixes.
+
+The recommended way is not to specify start offsets at all and specify partition size in MiB, GiB (or so). In this case *sfdisk* aligns all partitions to block-device I/O limits (or when I/O limits are too small then to megabyte boundary to keep disk layout portable). If this default behaviour is unwanted (usually for very small partitions) then specify offsets and sizes in sectors. In this case *sfdisk* entirely follows specified numbers without any optimization.
+
+*sfdisk* does not create the standard system partitions for SGI and SUN disk labels like *fdisk*(8) does. It is necessary to explicitly create all partitions including whole-disk system partitions.
+
+*sfdisk* uses *BLKRRPART* (reread partition table) ioctl to make sure that the device is not used by system or other tools (see also *--no-reread*). It's possible that this feature or another *sfdisk* activity races with *systemd-udevd*(8). The recommended way how to avoid possible collisions is to use *--lock* option. The exclusive lock will cause *systemd-udevd* to skip the event handling on the device.
+
+The *sfdisk* prompt is only a hint for users and a displayed partition number does not mean that the same partition table entry will be created (if *-N* not specified), especially for tables with gaps.
+
+== COMMANDS
+
+The commands are mutually exclusive.
+
+[*-N* _partition-number_] __device__::
+The default *sfdisk* command is to read the specification for the desired partitioning of _device_ from standard input, and then create a partition table according to the specification. See below for the description of the input format. If standard input is a terminal, then *sfdisk* starts an interactive session.
++
+If the option *-N* is specified, then the changes are applied to the partition addressed by _partition-number_. The unspecified fields of the partition are not modified.
++
+Note that it's possible to address an unused partition with *-N*. For example, an MBR always contains 4 partitions, but the number of used partitions may be smaller. In this case *sfdisk* follows the default values from the partition table and does not use built-in defaults for the unused partition given with *-N*. See also *--append*.
+
+*-A*, *--activate* __device__ [__partition-number__...]::
+Switch on the bootable flag for the specified partitions and switch off the bootable flag on all unspecified partitions. The special placeholder '-' may be used instead of the partition numbers to switch off the bootable flag on all partitions.
++
+The activation command is supported for MBR and PMBR only. If a GPT label is detected, then *sfdisk* prints warning and automatically enters PMBR.
++
+If no _partition-number_ is specified, then list the partitions with an enabled flag.
+
+*--backup-pt-sectors* _device_::
+Back up the current partition table sectors in binary format and exit. See the *BACKING UP THE PARTITION TABLE* section.
+
+*--delete* _device_ [__partition-number__...]::
+Delete all or the specified partitions.
+
+*-d*, *--dump* _device_::
+Dump the partitions of a device in a format that is usable as input to *sfdisk*. See the *BACKING UP THE PARTITION TABLE* section.
+
+*-g*, *--show-geometry* [__device__...]::
+List the geometry of all or the specified devices. For backward compatibility the deprecated option *--show-pt-geometry* have the same meaning as this one.
+
+*-J*, *--json* _device_::
+Dump the partitions of a device in JSON format. Note that *sfdisk* is not able to use JSON as input format.
+
+*-l*, *--list* [__device__...]::
+List the partitions of all or the specified devices. This command can be used together with *--verify*.
+
+*-F*, *--list-free* [__device__...]::
+List the free unpartitioned areas on all or the specified devices.
+
+*--part-attrs* _device partition-number_ [__attributes__]::
+Change the GPT partition attribute bits. If _attributes_ is not specified, then print the current partition settings. The _attributes_ argument is a comma- or space-delimited list of bits numbers or bit names. For example, the string "RequiredPartition,50,51" sets three bits. The currently supported attribute bits are:
++
+*Bit 0 (RequiredPartition)*;;
+If this bit is set, the partition is required for the platform to function. The creator of the partition indicates that deletion or modification of the contents can result in loss of platform features or failure for the platform to boot or operate. The system cannot function normally if this partition is removed, and it should be considered part of the hardware of the system.
+*Bit 1 (NoBlockIOProtocol)*;;
+EFI firmware should ignore the content of the partition and not try to read from it.
+*Bit 2 (LegacyBIOSBootable)*;;
+The partition may be bootable by legacy BIOS firmware.
+*Bits 3-47*;;
+Undefined and must be zero. Reserved for expansion by future versions of the UEFI specification.
+*Bits 48-63*;;
+Reserved for GUID specific use. The use of these bits will vary depending on the partition type. For example Microsoft uses bit 60 to indicate read-only, 61 for shadow copy of another partition, 62 for hidden partitions and 63 to disable automount.
+
+*--part-label* _device partition-number_ [__label__]::
+Change the GPT partition name (label). If _label_ is not specified, then print the current partition label.
+
+*--part-type* _device partition-number_ [__type__]::
+Change the partition type. If _type_ is not specified, then print the current partition type.
++
+The _type_ argument is hexadecimal for MBR, GUID for GPT, type alias (e.g. "linux") or type shortcut (e.g. 'L'). For backward compatibility the options *-c* and *--id* have the same meaning as this one.
+
+*--part-uuid* _device partition-number_ [__uuid__]::
+Change the GPT partition UUID. If _uuid_ is not specified, then print the current partition UUID.
+
+*--disk-id* _device_ [__id__]::
+Change the disk identifier. If _id_ is not specified, then print the current identifier. The identifier is UUID for GPT or unsigned integer for MBR.
+
+*-r*, *--reorder* _device_::
+Renumber the partitions, ordering them by their start offset.
+
+*-s*, *--show-size* [__device__...]::
+List the sizes of all or the specified devices in units of 1024 byte size. This command is DEPRECATED in favour of *blockdev*(8).
+
+*-T*, *--list-types*::
+Print all supported types for the current disk label or the label specified by *--label*.
+
+*-V*, *--verify* [__device__...]::
+Test whether the partition table and partitions seem correct.
+
+*--relocate* _oper_ _device_::
+Relocate partition table header. This command is currently supported for GPT header only. The argument _oper_ can be:
++
+*gpt-bak-std*;;
+Move GPT backup header to the standard location at the end of the device.
+*gpt-bak-mini*;;
+Move GPT backup header behind the last partition. Note that UEFI standard requires the backup header at the end of the device and partitioning tools can automatically relocate the header to follow the standard.
+
+== OPTIONS
+
+*-a*, *--append*::
+Don't create a new partition table, but only append the specified partitions.
++
+Note that unused partition maybe be re-used in this case although it is not the last partition in the partition table. See also *-N* to specify entry in the partition table.
+
+*-b*, *--backup*::
+Back up the current partition table sectors before starting the partitioning. The default backup file name is _~/sfdisk-<device>-<offset>.bak_; to use another name see option *-O*, *--backup-file*. See section *BACKING UP THE PARTITION TABLE* for more details.
+
+*--color*[**=**__when__]::
+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 the *--help* output. See also the *COLORS* section.
+
+*-f*, *--force*::
+Disable all consistency checking.
+
+*--Linux*::
+Deprecated and ignored option. Partitioning that is compatible with Linux (and other modern operating systems) is the default.
+
+*--lock*[=_mode_]::
+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.
+
+*-n*, *--no-act*::
+Do everything except writing to the device.
+
+*--no-reread*::
+Do not check through the re-read-partition-table ioctl whether the device is in use.
+
+*--no-tell-kernel*::
+Don't tell the kernel about partition changes. This option is recommended together with *--no-reread* to modify a partition on used disk. The modified partition should not be used (e.g., mounted).
+
+*-O*, *--backup-file* _path_::
+Override the default backup file name. Note that the device name and offset are always appended to the file name.
+
+*--move-data*[**=**__path__]::
+Move data after partition relocation, for example when moving the beginning of a partition to another place on the disk. The size of the partition has to remain the same, the new and old location may overlap. This option requires option *-N* in order to be processed on one specific partition only.
++
+The optional _path_ specifies log file name. The log file contains information about all read/write operations on the partition data. The word "@default" as a _path_ forces *sfdisk* to use _~/sfdisk-<devname>.move_ for the log. The log is optional since v2.35.
++
+Note that this operation is risky and not atomic. *Don't forget to backup your data!*
++
+See also *--move-use-fsync*.
++
+In the example below, the first command creates a 100MiB free area before the first partition and moves the data it contains (e.g., a filesystem), the next command creates a new partition from the free space (at offset 2048), and the last command reorders partitions to match disk order (the original sdc1 will become sdc2).
++
+*echo '+100M,' | sfdisk --move-data /dev/sdc -N 1* *echo '2048,' | sfdisk /dev/sdc --append* *sfdisk /dev/sdc --reorder*
+
+*--move-use-fsync*::
+Use the *fsync*(2) system call after each write when moving data to a new location by *--move-data*.
+
+*-o*, *--output* _list_::
+Specify which output columns to print. Use *--help* to get a list of all supported columns.
++
+The default list of columns may be extended if _list_ is specified in the format _{plus}list_ (e.g., *-o +UUID*).
+//TRANSLATORS: Keep {plus} untranslated.
+
+*-q*, *--quiet*::
+Suppress extra info messages.
+
+*-u*, *--unit S*::
+Deprecated option. Only the sector unit is supported. This option is not supported when using the *--show-size* command.
+
+*-X*, *--label* _type_::
+Specify the disk label type (e.g., *dos*, *gpt*, ...). If this option is not given, then *sfdisk* defaults to the existing label, but if there is no label on the device yet, then the type defaults to *dos*. The default or the current label may be overwritten by the "label: <name>" script header line. The option *--label* does not force *sfdisk* to create empty disk label (see the *EMPTY DISK LABEL* section below).
+
+*-Y*, *--label-nested* _type_::
+Force editing of a nested disk label. The primary disk label has to exist already. This option allows editing for example a hybrid/protective MBR on devices with GPT.
+
+*-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*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode; except the old partition-table signatures which are always wiped before create a new partition-table if the argument _when_ is not *never*. The *auto* mode also does not wipe the first sector (boot sector), it is necessary to use the *always* mode to wipe this area. In all cases detected signatures are reported by warning messages before a new partition table is created. See also the *wipefs*(8) command.
+
+*-W*, *--wipe-partitions* _when_::
+Wipe filesystem, RAID and partition-table signatures from a newly created partition, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, 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 after a new partition is created. See also *wipefs*(8) command.
+
+*-v*, *--version*::
+Display version information and exit.
+
+*-h*, *--help*::
+Display help text and exit.
+
+== INPUT FORMATS
+
+*sfdisk* supports two input formats and generic header lines.
+
+=== Header lines
+
+The optional header lines specify generic information that apply to the partition table. The header-line format is:
+
+*<name>: <value>*
+
+The currently recognized headers are:
+
+*unit*::
+Specify the partitioning unit. The only supported unit is *sectors*.
+*label*::
+Specify the partition table type. For example *dos* or *gpt*.
+*label-id*::
+Specify the partition table identifier. It should be a hexadecimal number (with a 0x prefix) for MBR and a UUID for GPT.
+*first-lba*::
+Specify the first usable sector for GPT partitions.
+*last-lba*::
+Specify the last usable sector for GPT partitions.
+*table-length*::
+Specify the maximal number of GPT partitions.
+*grain*::
+Specify minimal size in bytes used to calculate partitions alignment. The default is 1MiB and it's strongly recommended to use the default. Do not modify this variable if you're not sure.
+*sector-size*::
+Specify sector size. This header is informative only and it is not used when *sfdisk* creates a new partition table, in this case the real device specific value is always used and sector size from the dump is ignored.
+
+Note that it is only possible to use header lines before the first partition is specified in the input.
+
+=== Unnamed-fields format
+
+____
+_start size type bootable_
+____
+
+where each line fills one partition descriptor.
+
+Fields are separated by whitespace, comma (recommended) or semicolon possibly followed by whitespace; initial and trailing whitespace is ignored. Numbers can be octal, decimal or hexadecimal; decimal is the default. When a field is absent, empty or specified as '-' a default value is used. But when the *-N* option (change a single partition) is given, the default for each field is its previous value.
+
+The default value of _start_ is the first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes. Since v2.38 when the *-N* option (change a single partition) is given, a '{plus}' can be used to enlarge partition by move start of the partition if there is a free space before the partition.
+
+//TRANSLATORS: Keep {plus} untranslated.
+The default value of _size_ indicates "as much as possible"; i.e., until the next partition or end-of-device. A numerical argument is by default interpreted as a number of sectors, however if the size is followed by one of the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as the size of the partition in bytes and it is then aligned according to the device I/O limits. A '{plus}' can be used instead of a number to enlarge the partition as much as possible. Note '{plus}' is equivalent to the default behaviour for a new partition; existing partitions will be resized as required.
+
+The partition _type_ is given in hex for MBR (DOS) where 0x prefix is optional; a GUID string for GPT; a shortcut or an alias. It's recommended to use two letters for MBR hex codes to avoid collision between deprecated shortcut 'E' and '0E' MBR hex code. For backward compatibility *sfdisk* tries to interpret _type_ as a shortcut as a first possibility in partitioning scripts although on other places (e.g. *--part-type* command) it tries shortcuts as the last possibility.
+
+Since v2.36 libfdisk supports partition type aliases as extension to shortcuts. The alias is a simple human readable word (e.g. "linux").
+
+Since v2.37 libfdisk supports partition type names on input, ignoring the case of the characters and all non-alphanumeric and non-digit characters in the name (e.g. "Linux /usr x86" is the same as "linux usr-x86").
+
+Supported shortcuts and aliases:
+
+*L - alias 'linux'*::
+Linux; means 83 for MBR and 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for GPT.
+
+*S - alias 'swap'*::
+swap area; means 82 for MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F for GPT
+
+*Ex - alias 'extended'*::
+MBR extended partition; means 05 for MBR. The original shortcut 'E' is deprecated due to collision with 0x0E MBR partition type.
+
+*H - alias 'home'*::
+home partition; means 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 for GPT
+
+*U - alias 'uefi'*::
+EFI System partition, means EF for MBR and C12A7328-F81F-11D2-BA4B-00A0C93EC93B for GPT
+
+*R - alias 'raid'*::
+Linux RAID; means FD for MBR and A19D880F-05FC-4D3B-A006-743F0F84911E for GPT
+
+*V - alias 'lvm'*::
+LVM; means 8E for MBR and E6D6D379-F507-44C2-A23C-238F2A3DF928 for GPT
+
+The default _type_ value is _linux_.
+
+The shortcut 'X' for Linux extended partition (85) is deprecated in favour of 'Ex'.
+
+// TRANSLATORS: Keep {asterisk} untranslated.
+_bootable_ is specified as [*{asterisk}*|*-*], with as default not-bootable. The value of this field is irrelevant for Linux - when Linux runs it has been booted already - but it might play a role for certain boot loaders and for other operating systems.
+
+=== Named-fields format
+
+This format is more readable, robust, extensible and allows specifying additional information (e.g., a UUID). It is recommended to use this format to keep your scripts more readable.
+
+____
+[_device_ *:*] _name_[**=**__value__], ...
+____
+
+The _device_ field is optional. *sfdisk* extracts the partition number from the device name. It allows specifying the partitions in random order. This functionality is mostly used by *--dump*. Don't use it if you are not sure.
+
+The _value_ can be between quotation marks (e.g., name="This is partition name"). The fields *start=* and *size=* support '{plus}' and '-' in the same way as *Unnamed-fields format*.
+
+The currently supported fields are:
+
+**start=**__number__::
+The first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes.
+
+**size=**__number__::
+Specify the partition size in sectors. The number may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it's interpreted as size in bytes and the size is aligned according to device I/O limits.
+
+*bootable*::
+Mark the partition as bootable.
+
+**attrs=**__string__::
+Partition attributes, usually GPT partition attribute bits. See *--part-attrs* for more details about the GPT-bits string format.
+
+**uuid=**__string__::
+GPT partition UUID.
+
+**name=**__string__::
+GPT partition name.
+
+**type=**__code__::
+A hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition, a shortcut as for unnamed-fields format or a type name (e.g. type="Linux /usr (x86)"). See above the section about the unnamed-fields format for more details. For backward compatibility the *Id=* field has the same meaning.
+
+== EMPTY DISK LABEL
+
+*sfdisk* does not create partition table without partitions by default. The lines with partitions are expected in the script by default. The empty partition table has to be explicitly requested by "label: <name>" script header line without any partitions lines. For example:
+
+____
+*echo 'label: gpt' | sfdisk /dev/sdb*
+____
+
+creates empty GPT partition table. Note that the *--append* disables this feature.
+
+== BACKING UP THE PARTITION TABLE
+
+It is recommended to save the layout of your devices. *sfdisk* supports two ways.
+
+=== Dump in sfdisk compatible format
+
+Use the *--dump* command to save a description of the device layout to a text file.
+The dump format is suitable for later *sfdisk* input. For example:
+____
+*sfdisk --dump /dev/sda > sda.dump*
+____
+
+This can later be restored by:
+____
+*sfdisk /dev/sda < sda.dump*
+____
+
+=== Full binary backup
+
+If you want to do a full binary backup of all sectors where the partition table is stored, then use the *--backup-pt-sectors* command. It writes the sectors to _~/sfdisk-<device>-<offset>.bak_ files. The default name of the backup file can be changed with the *--backup-file* option. The backup files contain only raw data from the _device_. For example:
+
+____
+*sfdisk --backup-pt-sectors /dev/sda*
+____
+
+The GPT header can later be restored by:
+
+____
+*dd if=~/sfdisk-sda-0x00000200.bak of=/dev/sda seek=$\((0x00000200)) bs=1 conv=notrunc*
+____
+
+
+It's also possible to use the *--backup* option to create the same backup immediately after startup for other *sfdisk* commands. For example, backup partition table before deleting all partitions from partition table:
+____
+*sfdisk --backup --delete /dev/sda*
+____
+
+
+The same concept of backup files is used by *wipefs*(8).
+
+Note that *sfdisk* since version 2.26 no longer provides the *-I* option to restore sectors. *dd*(1) provides all necessary functionality.
+
+include::man-common/colors.adoc[]
+
+The logical color names supported by *sfdisk* are:
+
+*header*::
+The header of the output tables.
+*warn*::
+The warning messages.
+*welcome*::
+The welcome message.
+
+== ENVIRONMENT
+
+*SFDISK_DEBUG*=all::
+enables *sfdisk* debug output.
+*LIBFDISK_DEBUG*=all::
+enables libfdisk debug output.
+*LIBBLKID_DEBUG*=all::
+enables libblkid debug output.
+*LIBSMARTCOLS_DEBUG*=all::
+enables libsmartcols debug output.
+*LOCK_BLOCK_DEVICE*=<mode>::
+use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
+
+== NOTES
+
+Since version 2.26 *sfdisk* no longer provides the *-R* or *--re-read* option to force the kernel to reread the partition table. Use *blockdev --rereadpt* instead.
+
+Since version 2.26 *sfdisk* does not provide the *--DOS*, *--IBM*, *--DOS-extended*, *--unhide*, *--show-extended*, *--cylinders*, *--heads*, *--sectors*, *--inside-outer*, *--not-inside-outer* options.
+
+== EXAMPLES
+
+*sfdisk --list --label-nested=mbr /dev/sda*::
+Print protective MBR on device with GPT disk label.
+
+*echo -e ',10M,L\n,10M,L\n,+,\n' | sfdisk /dev/sdc*::
+Create three Linux partitions, with the default start, the size of the first two partitions is 10MiB, and the last partition fills all available space on the device.
+
+*echo -e 'size=10M, type=L\n size=10M, type=L\n size=+\n' | sfdisk /dev/sdc*::
+The same as the previous example, but in named-fields format.
+
+*echo -e 'type=swap' | sfdisk -N 3 /dev/sdc*::
+Set type of the 3rd partition to 'swap'.
+
+*sfdisk --part-type /dev/sdc 3 swap*::
+The same as the previous example, but without script use.
+
+*sfdisk --delete /dev/sdc 2*::
+Delete 2nd partition.
+
+*echo "+,+" | sfdisk -N 3 --move-data /dev/sdc*::
+Enlarge 3rd partition in both directions, move start to use free space before the partition and enlarge the size to use all free space after to the partition, and move partition data too.
+
+== AUTHORS
+
+mailto:kzak@redhat.com[Karel Zak]
+
+The current *sfdisk* implementation is based on the original *sfdisk* from Andries E. Brouwer.
+
+== SEE ALSO
+
+*fdisk*(8),
+*cfdisk*(8),
+*parted*(8),
+*partprobe*(8),
+*partx*(8)
+
+include::man-common/bugreports.adoc[]
+
+include::man-common/footer.adoc[]
+
+ifdef::translation[]
+include::man-common/translation.adoc[]
+endif::[]