]> git.ipfire.org Git - thirdparty/util-linux.git/blame - disk-utils/sfdisk.8
fstrim shouldn't run inside a container
[thirdparty/util-linux.git] / disk-utils / sfdisk.8
CommitLineData
5aac7429
KZ
1.\" sfdisk.8 -- man page for sfdisk
2.\" Copyright (C) 2014 Karel Zak <kzak@redhat.com>
fd6b7a7f 3.\"
5aac7429
KZ
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
7f576918 13.TH SFDISK 8 "June 2015" "util-linux" "System Administration"
fd6b7a7f 14.SH NAME
5aac7429 15sfdisk \- display or manipulate a disk partition table
fd6b7a7f 16.SH SYNOPSIS
b61dfcf5 17.B sfdisk
f49ccec2
BS
18[options]
19.I device
20.RB [ \-N
21.IR partition-number ]
5aac7429
KZ
22.sp
23.B sfdisk
f49ccec2
BS
24[options]
25.I command
fd6b7a7f
KZ
26.SH DESCRIPTION
27.B sfdisk
689d83de 28is a script-oriented tool for partitioning any block device.
fd6b7a7f 29
d5206b96 30Since version 2.26
5dbff4c0 31.B sfdisk
5aac7429
KZ
32supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any
33functionality for CHS (Cylinder-Head-Sector) addressing. CHS has
34never been important for Linux, and this addressing concept does not make any
35sense for new devices.
689d83de 36.sp
b69719b6 37.B sfdisk
86800f5d
KZ
38(since version 2.26)
39.B aligns the start and end of partitions
40to block-device I/O limits when relative sizes are specified, when the default
b9c3b903 41values are used or when multiplicative suffixes (e.g. MiB) are used for sizes.
86800f5d
KZ
42It is possible that partition size will be optimized (reduced or enlarged) due
43to alignment if the start offset is specified exactly in sectors and partition
44size relative or by multiplicative suffixes.
45
46The recommended way is not to specify start offsets at all and specify
47partition size in MiB, GiB (or so). In this case sfdisk align all partitions
48to block-device I/O limits (or when I/O limits are too small then to megabyte
49boundary to keep disk layout portable). If this default behaviour is unwanted
208b2ef0
KZ
50(usually for very small partitions) then specify offsets and sizes in
51sectors. In this case sfdisk entirely follows specified numbers without any
52optimization.
689d83de 53.sp
a8a4887b 54.B sfdisk
689d83de
BS
55does not create the standard system partitions for SGI and SUN disk labels like
56.BR fdisk (8)
57does.
a8a4887b
KZ
58It is necessary to explicitly create all partitions including whole-disk system
59partitions.
60
aefa920a
KZ
61.B sfdisk
62uses BLKRRPART (reread partition table) ioctl to make sure that the device is
63not used by system or another tools (see also --no-reread). It's possible that
64this feature or another sfdisk activity races with \fBudevd\fR. The recommended way
65how to avoid possible collisions is to use exclusive flock for the whole-disk
66device to serialize device access. The exclusive lock will cause udevd to skip
67the event handling on the device. For example:
68.RS
69.sp
70.nf
71.B "flock /dev/sdc sfdisk /dev/sdc"
72.fi
73.sp
74.RE
75Note, this semantic is not currently supported by udevd for MD and DM devices.
76
5aac7429
KZ
77.SH COMMANDS
78The commands are mutually exclusive.
fd6b7a7f 79.TP
f49ccec2 80.RB [ \-N " \fIpartition-number\fR] " \fIdevice\fR
689d83de 81The default \fBsfdisk\fR command is to read the specification for the desired
5aac7429 82partitioning of \fIdevice\fR from standard input, and then create a partition
689d83de
BS
83table according to the specification. See below for the description of the
84input format. If standard input is a terminal, then \fBsfdisk\fR starts an
85interactive session.
86.sp
87If the option \fB\-N\fR is specified, then the changes are applied to
7f576918 88the partition addressed by \fIpartition-number\fR. The unspecified fields
d754d554
KZ
89of the partition are not modified.
90.sp
7f576918
BS
91Note that it's possible to address an unused partition with \fB\-N\fR.
92For example, an MBR always contains 4 partitions, but the number of used
93partitions may be smaller. In this case \fBsfdisk\fR follows the default
94values from the partition table and does not use built-in defaults for the
c805c369 95unused partition given with \fB\-N\fR. See also \fB\-\-append\fR.
fd6b7a7f 96.TP
8175ed3d
KZ
97.BR \-A , " \-\-activate \fIdevice " [ \fIpartition-number...]
98Switch on the bootable flag for the specified partitions and switch off the
99bootable flag on all unspecified partitions. The special placeholder '-'
100may be used instead of the partition numbers to switch off the bootable flag
101on all partitions.
102
49032ef7
KZ
103The activation command is supported for MBR and PMBR only. If GPT label is detected
104than sfdisk prints warning and automatically enter PMBR.
105
8175ed3d
KZ
106If no \fIpartition-number\fR is specified, then list the partitions with an
107enabled flag.
9a79aa6e 108.TP
c805c369
BS
109.BR "\-\-delete \fIdevice " [ \fIpartition-number ...]
110Delete all or the specified partitions.
aab9be66 111.TP
9a79aa6e 112.BR \-d , " \-\-dump " \fIdevice\fR
7f576918 113Dump the partitions of a device in a format that is usable as input to \fBsfdisk\fR.
689d83de 114See the section \fBBACKING UP THE PARTITION TABLE\fR.
9a79aa6e 115.TP
b06c1ca6 116.BR \-g , " \-\-show\-geometry " [ \fIdevice ...]
349ac672
KZ
117List the geometry of all or the specified devices. For backward
118compatibility the deprecated option \fB\-\-show\-pt\-geometry\fR have the same
119meaning as this one.
7f576918 120.TP
a592b4b5 121.BR \-J , " \-\-json " \fIdevice\fR
7f576918
BS
122Dump the partitions of a device in JSON format. Note that \fBsfdisk\fR is
123not able to use JSON as input format.
9a79aa6e 124.TP
689d83de
BS
125.BR \-l , " \-\-list " [ \fIdevice ...]
126List the partitions of all or the specified devices. This command can be used
9a79aa6e
KZ
127together with \fB\-\-verify\fR.
128.TP
8abdb912
KZ
129.BR \-F , " \-\-list-free " [ \fIdevice ...]
130List the free unpartitioned areas on all or the specified devices.
131.TP
c805c369
BS
132.BR "\-\-part\-attrs \fIdevice partition-number " [ \fIattributes ]
133Change the GPT partition attribute bits. If \fIattributes\fR is not specified,
134then print the current partition settings. The \fIattributes\fR argument is a
689d83de 135comma- or space-delimited list of bits. The currently supported attribute
d1b7bfe5 136bits are: RequiredPartition, NoBlockIOProtocol, LegacyBIOSBootable
689d83de 137and GUID-specific bits in the range from 48 to 63. For example, the string
d1b7bfe5 138"RequiredPartition,50,51" sets three bits.
bc9e8547 139.TP
c805c369 140.BR "\-\-part\-label \fIdevice partition-number " [ \fIlabel ]
80840c16 141Change the GPT partition name (label). If \fIlabel\fR is not specified,
689d83de 142then print the current partition label.
e36fb07a 143.TP
c805c369 144.BR "\-\-part\-type \fIdevice partition-number " [ \fItype ]
689d83de
BS
145Change the partition type. If \fItype\fR is not specified, then print the
146current partition type. The \fItype\fR argument is hexadecimal for MBR,
147or a GUID for GPT. For backward compatibility the options \fB\-c\fR and
c805c369 148\fB\-\-id\fR have the same meaning as this one.
e36fb07a 149.TP
c805c369 150.BR "\-\-part\-uuid \fIdevice partition-number " [ \fIuuid ]
689d83de
BS
151Change the GPT partition UUID. If \fIuuid\fR is not specified,
152then print the current partition UUID.
e36fb07a 153.TP
9a17d946 154.BR \-r , " \-\-reorder " \fIdevice
c805c369 155Renumber the partitions, ordering them by their start offset.
9a17d946 156.TP
b06c1ca6 157.BR \-s , " \-\-show\-size " [ \fIdevice ...]
b0ff9a76
CM
158List the sizes of all or the specified devices in units of 1024 byte size.
159This command is DEPRECATED in favour of
160.BR blockdev (1).
9a79aa6e 161.TP
b06c1ca6 162.BR \-T , " \-\-list\-types"
689d83de 163Print all supported types for the current disk label or the label specified by
9a79aa6e 164\fB\-\-label\fR.
3a5bdedf 165.TP
3f43f5d0 166.BR \-V , " \-\-verify " [ \fIdevice ...]
689d83de 167Test whether the partition table and partitions seem correct.
5aac7429
KZ
168
169.SH OPTIONS
fd6b7a7f 170.TP
703ab082 171.BR \-a , " \-\-append"
689d83de 172Don't create a new partition table, but only append the specified partitions.
fd6b7a7f 173.TP
5aac7429 174.BR \-b , " \-\-backup"
689d83de
BS
175Back up the current partition table sectors before starting the partitioning.
176The default backup file name is ~/sfdisk-<device>-<offset>.bak; to use another
7f576918 177name see option \fB\-O\fR, \fB\-\-backup\-file\fR.
f74478a6 178.TP
7e3b3f47 179.BR \-\-color [ =\fIwhen ]
da25898b
KZ
180Colorize the output. The optional argument \fIwhen\fP
181can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted,
7f576918
BS
182it defaults to \fBauto\fR. The colors can be disabled; for the current built-in default
183see the \fB\-\-help\fR output. See also the \fBCOLORS\fR section.
da25898b 184.TP
5aac7429
KZ
185.BR \-f , " \-\-force"
186Disable all consistency checking.
f74478a6 187.TP
0bb7e904 188.B \-\-Linux
80840c16 189Deprecated and ignored option. Partitioning that is compatible with
7f576918 190Linux (and other modern operating systems) is the default.
80840c16
BS
191.TP
192.BR \-n , " \-\-no\-act"
193Do everything except writing to the device.
194.TP
195.B \-\-no\-reread
196Do not check through the re-read-partition-table ioctl whether the device is in use.
197.TP
d4a90151
KZ
198.B \-\-no\-tell\-kernel
199Don't tell the kernel about partition changes. This option is recommended together
200with \fB\-\-no\-reread\fR to modify a partition on used disk. The modified partition
201should not be used (e.g. mounted).
202.TP
c805c369 203.BR \-O , " \-\-backup\-file " \fIpath
80840c16
BS
204Override the default backup file name. Note that the device name and offset
205are always appended to the file name.
f42205d8 206.TP
7e3b3f47 207.BR \-\-move-data [ =\fIpath ]
c805c369
BS
208Move data after partition relocation, for example when moving the beginning
209of a partition to another place on the disk. The size of the partition has
210to remain the same, the new and old location may overlap. This option requires
211option \fB\-N\fR in order to be processed on one specific partition only.
f42205d8
KZ
212
213The \fIpath\fR overrides the default log file name
c805c369
BS
214(the default is ~/sfdisk-<devname>.move). The log file contains information
215about all read/write operations on the partition data.
f42205d8 216
c805c369 217Note that this operation is risky and not atomic. \fBDon't forget to backup your data!\fR
f42205d8 218
c805c369
BS
219In the example below, the first command creates a 100MiB free area before
220the first partition and moves the data it contains (e.g. a filesystem),
221the next command creates a new partition from the free space (at offset 2048),
222and the last command reorders partitions to match disk order
223(the original sdc1 will become sdc2).
f42205d8
KZ
224.RS
225.sp
226.B "echo '+100M,' | sfdisk --move-data /dev/sdc -N 1"
227.br
228.B "echo '2048,' | sfdisk /dev/sdc --append
229.br
230.B sfdisk /dev/sdc --reorder
231.sp
232.RE
233
80840c16 234.TP
689d83de 235.BR \-o , " \-\-output " \fIlist
01f9286c
KZ
236Specify which output columns to print. Use
237.B \-\-help
238to get a list of all supported columns.
689d83de 239.sp
01f9286c
KZ
240The default list of columns may be extended if \fIlist\fP is
241specified in the format \fI+list\fP (e.g. \fB-o +UUID\fP).
242.TP
5aac7429
KZ
243.BR \-q , " \-\-quiet"
244Suppress extra info messages.
f74478a6 245.TP
689d83de 246.BR \-u , " \-\-unit S"
b0ff9a76
CM
247Deprecated option. Only the sector unit is supported. This option is not
248supported when using the --show-size command.
f74478a6 249.TP
689d83de
BS
250.BR \-X , " \-\-label " \fItype
251Specify the disk label type (e.g. \fBdos\fR, \fBgpt\fR, ...). If this option
252is not given, then \fBsfdisk\fR defaults to the existing label, but if there
35ca5118
KZ
253is no label on the device yet, then the type defaults to \fBdos\fR. The default
254or the current label may be overwritten by the "label: <name>" script header
255line. The option \fB\-\-label\fR does not force \fBsfdisk\fR to create empty
256disk label (see the \fBEMPTY DISK LABEL\fR section below).
01f9286c 257.TP
b06c1ca6 258.BR \-Y , " \-\-label\-nested " \fItype
689d83de
BS
259Force editing of a nested disk label. The primary disk label has to exist already.
260This option allows to edit for example a hybrid/protective MBR on devices with GPT.
15b5e942
KZ
261
262.TP
589b6931
BS
263.BR -w , " \-\-wipe "\fIwhen
264Wipe filesystem, RAID and partition-table signatures from the device, in order
265to avoid possible collisions. The argument \fIwhen\fR can be \fBauto\fR,
266\fBnever\fR or \fBalways\fR. When this option is not given, the default is
bb881527
KZ
267\fBauto\fR, in which case signatures are wiped only when in interactive mode;
268except the old partition-table signatures which are always wiped before create
269a new partition-table if the argument \fIwhen\fR is not \fBnever\fR. In all
270cases detected signatures are reported by warning messages before a new
271partition table is created. See also
15b5e942
KZ
272.BR wipefs (8)
273command.
274
3d6db3fd
KZ
275.TP
276.BR -W , " \-\-wipe-partitions "\fIwhen
277Wipe filesystem, RAID and partition-table signatures from a newly created
278partitions, in order to avoid possible collisions. The argument \fIwhen\fR can
279be \fBauto\fR, \fBnever\fR or \fBalways\fR. When this option is not given, the
280default is \fBauto\fR, in which case signatures are wiped only when in
281interactive mode and after confirmation by user. In all cases detected
282signatures are reported by warning messages after a new partition is created.
283See also
284.BR wipefs (8)
285command.
286
689d83de
BS
287.TP
288.BR \-v , " \-\-version"
289Display version information and exit.
e1422de3 290.TP
5aac7429
KZ
291.BR \-h , " \-\-help"
292Display help text and exit.
fd6b7a7f 293
9a79aa6e
KZ
294.SH "INPUT FORMATS"
295.B sfdisk
296supports two input formats and generic header lines.
297
298.B Header lines
299.RS
689d83de
BS
300The optional header lines specify generic information that apply to the partition
301table. The header-line format is:
302.RS
303.sp
9a79aa6e 304.B "<name>: <value>"
689d83de
BS
305.sp
306.RE
9a79aa6e
KZ
307The currently recognized headers are:
308.RS
309.TP
310.B unit
689d83de 311Specify the partitioning unit. The only supported unit is \fBsectors\fR.
9a79aa6e
KZ
312.TP
313.B label
689d83de 314Specify the partition table type. For example \fBdos\fR or \fBgpt\fR.
9a79aa6e
KZ
315.TP
316.B label-id
689d83de
BS
317Specify the partition table identifier. It should be a hexadecimal number
318(with a 0x prefix) for MBR and a UUID for GPT.
aef79c1f
KZ
319.TP
320.B first-lba
321Specify the first usable sector for GPT partitions.
322.TP
323.B last-lba
324Specify the last usable sector for GPT partitions.
325.TP
326.B table-length
327Specify the maximal number of GPT partitions.
e4386c8c
KZ
328.TP
329.B grain
330Specify minimal size in bytes used to calculate partitions alignment. The
331default is 1MiB and it's strongly recommended to use the default. Do not
332modify this variable if you're not sure.
9a79aa6e
KZ
333.RE
334.sp
689d83de 335Note that it is only possible to use header lines before the first partition
9a79aa6e
KZ
336is specified in the input.
337.RE
338
689d83de
BS
339.B Unnamed-fields format
340.RS
9a79aa6e 341.RS
689d83de
BS
342.sp
343.I start size type bootable
344.sp
345.RE
9a79aa6e 346where each line fills one partition descriptor.
689d83de 347.sp
11aa2aa2
IW
348Fields are separated by whitespace, comma or semicolon possibly
349followed by whitespace; initial and trailing whitespace is ignored.
350Numbers can be octal, decimal or hexadecimal; decimal is the default.
351When a field is absent, empty or specified as '-' a default value is
352used. But when the \fB-N\fR option (change a single partition) is
353given, the default for each field is its previous value.
689d83de 354.sp
9a79aa6e
KZ
355The default value of
356.I start
689d83de 357is the first non-assigned sector aligned according to device I/O limits.
c805c369 358The default start offset for the first partition is 1 MiB. The offset may
80840c16 359be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB,
ce9f568c 360EiB, ZiB and YiB) then the number is interpreted as offset in bytes.
689d83de 361.sp
9a79aa6e
KZ
362The default value of
363.I size
11aa2aa2
IW
364indicates "as much as possible"; i.e. until the next partition or
365end-of-device. A numerical argument is by default interpreted as a
366number of sectors, however if the size is followed by one of the
367multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB)
368then the number is interpreted as the size of the partition in bytes
369and it is then aligned according to the device I/O limits. A '+' can
370be used instead of a number to enlarge the partition as much as
371possible. Note '+' is equivalent to the default behaviour for a new
372partition; existing partitions will be resized as required.
689d83de
BS
373.sp
374The partition
9a79aa6e 375.I type
689d83de
BS
376is given in hex for MBR (DOS), without the 0x prefix, a GUID string for GPT, or
377a shortcut:
9a79aa6e
KZ
378.RS
379.TP
689d83de 380.B L
9a79aa6e
KZ
381Linux; means 83 for MBR and 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for GPT.
382.TP
689d83de 383.B S
9a79aa6e
KZ
384swap area; means 82 for MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F for GPT
385.TP
386.B E
387extended partition; means 5 for MBR
388.TP
389.B H
390home partition; means 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 for GPT
391.TP
392.B X
393linux extended partition; means 85 for MBR.
d09c06ba
KZ
394.TP
395.B U
300e24a8 396EFI System partition, means EF for MBR and C12A7328-F81F-11D2-BA4B-00A0C93EC93B for GPT
6ebc3785
KZ
397.TP
398.B R
7e95fd82 399Linux RAID; means FD for MBR and A19D880F-05FC-4D3B-A006-743F0F84911E for GPT
6ebc3785
KZ
400.TP
401.B V
7e95fd82 402LVM; means 8E for MBR and E6D6D379-F507-44C2-A23C-238F2A3DF928 for GPT
9a79aa6e 403.RE
11aa2aa2
IW
404.PP
405The default
406.I type
407value is
408.I L
9a79aa6e 409
689d83de 410.I bootable
11aa2aa2
IW
411is specified as [\fB*\fR|\fB-\fR], with as default not-bootable. The
412value of this field is irrelevant for Linux - when Linux runs it has
413been booted already - but ir might play a role for certain boot
414loaders and for other operating systems.
9a79aa6e
KZ
415.RE
416
689d83de 417.B Named-fields format
9a79aa6e 418.RS
d35df4db 419This format is more readable, robust, extensible and allows to specify additional
80840c16 420information (e.g. a UUID). It is recommended to use this format to keep your scripts
9a79aa6e 421more readable.
689d83de
BS
422.RS
423.sp
424.RI [ "device \fB:" ] " name" [\fB= value "], ..."
425.sp
426.RE
427The
9a79aa6e 428.I device
c805c369 429field is optional. \fBsfdisk\fR extracts the partition number from the
689d83de 430device name. It allows to specify the partitions in random order.
97325257 431This functionality is mostly used by \fB\-\-dump\fR.
689d83de 432Don't use it if you are not sure.
9a79aa6e
KZ
433
434The
435.I value
689d83de
BS
436can be between quotation marks (e.g. name="This is partition name").
437The currently supported fields are:
9a79aa6e
KZ
438.RS
439.TP
689d83de
BS
440.BI start= number
441The first non-assigned sector aligned according to device I/O limits. The default
ce9f568c
KZ
442start offset for the first partition is 1 MiB. The offset may be followed by
443the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then
444the number is interpreted as offset in bytes.
9a79aa6e 445.TP
689d83de
BS
446.BI size= number
447Specify the partition size in sectors. The number may be followed by the multiplicative
9a79aa6e
KZ
448suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it's interpreted as size
449in bytes and the size is aligned according to device I/O limits.
450.TP
689d83de
BS
451.B bootable
452Mark the partition as bootable.
9a79aa6e 453.TP
689d83de
BS
454.BI attrs= string
455Partition attributes, usually GPT partition attribute bits. See
b06c1ca6 456\fB\-\-part\-attrs\fR for more details about the GPT-bits string format.
9a79aa6e 457.TP
689d83de 458.BI uuid= string
9a79aa6e
KZ
459GPT partition UUID.
460.TP
689d83de 461.BI name= string
9a79aa6e
KZ
462GPT partition name.
463.TP
689d83de 464.BI type= code
08474fde
KZ
465A hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition,
466or a shortcut as for unnamed-fields format.
689d83de 467For backward compatibility the \fBId=\fR field has the same meaning.
9a79aa6e
KZ
468.RE
469.RE
470
35ca5118
KZ
471.SH "EMPTY DISK LABEL"
472.B sfdisk
473does not create partition table without partitions by default. The lines with
474partitions are expected in the script by default. The empty partition table has
475to be explicitly requested by "label: <name>" script header line without any
476partitions lines. For example:
477.RS
478.sp
479.B "echo 'label: gpt' | sfdisk /dev/sdb"
480.sp
481.RE
482creates empty GPT partition table. Note that the \fB\-\-append\fR disables this feature.
483
689d83de
BS
484.SH "BACKING UP THE PARTITION TABLE"
485It is recommended to save the layout of your devices.
9a79aa6e
KZ
486.B sfdisk
487supports two ways.
689d83de
BS
488.sp
489Use the \fB\-\-dump\fR option to save a description of the device layout
490to a text file. The dump format is suitable for later \fBsfdisk\fR input.
491For example:
9a79aa6e
KZ
492.RS
493.sp
494.B "sfdisk --dump /dev/sda > sda.dump"
495.sp
496.RE
689d83de 497This can later be restored by:
9a79aa6e
KZ
498.RS
499.sp
500.B "sfdisk /dev/sda < sda.dump"
501.RE
502
689d83de
BS
503If you want to do a full (binary) backup of all sectors where the
504partition table is stored,
505then use the \fB\-\-backup\fR option. It writes the sectors to
506~/sfdisk-<device>-<offset>.bak files. The default name of the backup file can
507be changed with the \fB\-\-backup\-file\fR option. The backup files
508contain only raw data from the \fIdevice\fR.
509Note that the same concept of backup files is used by
510.BR wipefs (8).
511For example:
9a79aa6e
KZ
512.RS
513.sp
514.B "sfdisk --backup /dev/sda"
515.sp
516.RE
689d83de 517The GPT header can later be restored by:
9a79aa6e
KZ
518.RS
519.sp
c805c369
BS
520.nf
521.B "dd if=~/sfdisk-sda-0x00000200.bak of=/dev/sda \e"
522.B " seek=$((0x00000200)) bs=1 conv=notrunc"
523.fi
9a79aa6e
KZ
524.sp
525.RE
689d83de
BS
526Note that \fBsfdisk\fR since version 2.26 no longer provides the \fB\-I\fR option to
527restore sectors.
5593132a 528.BR dd (1)
9a79aa6e
KZ
529provides all necessary functionality.
530
da25898b
KZ
531.SH COLORS
532Implicit coloring can be disabled by an empty file \fI/etc/terminal-colors.d/sfdisk.disable\fR.
533
534See
535.BR terminal-colors.d (5)
536for more details about colorization configuration. The logical color names
537supported by
538.B sfdisk
539are:
540.TP
541.B header
542The header of the output tables.
543.TP
544.B warn
545The warning messages.
546.TP
547.B welcome
548The welcome message.
549
9a79aa6e 550.SH NOTES
689d83de 551Since version 2.26 \fBsfdisk\fR no longer provides the \fB\-R\fR or
b06c1ca6 552\fB\-\-re\-read\fR option to force the kernel to reread the partition table.
689d83de 553Use \fBblockdev \-\-rereadpt\fR instead.
9a79aa6e 554.PP
b06c1ca6
WP
555Since version 2.26 \fBsfdisk\fR does not provide the \fB\-\-DOS\fR, \fB\-\-IBM\fR, \fB\-\-DOS\-extended\fR,
556\fB\-\-unhide\fR, \fB\-\-show\-extended\fR, \fB\-\-cylinders\fR, \fB\-\-heads\fR, \fB\-\-sectors\fR,
557\fB\-\-inside\-outer\fR, \fB\-\-not\-inside\-outer\fR options.
9a79aa6e 558
68e422ec 559.SH ENVIRONMENT
47dd6918
KZ
560.IP SFDISK_DEBUG=all
561enables sfdisk debug output.
68e422ec
KZ
562.IP LIBFDISK_DEBUG=all
563enables libfdisk debug output.
564.IP LIBBLKID_DEBUG=all
565enables libblkid debug output.
566.IP LIBSMARTCOLS_DEBUG=all
567enables libsmartcols debug output.
568
612721db 569.SH "SEE ALSO"
612721db 570.BR fdisk (8),
5aac7429 571.BR cfdisk (8),
c64061c9
VD
572.BR parted (8),
573.BR partprobe (8),
5593132a 574.BR partx (8)
689d83de 575
5aac7429
KZ
576.SH AUTHOR
577Karel Zak <kzak@redhat.com>
578.PP
579The current sfdisk implementation is based on the original sfdisk
580from Andries E. Brouwer.
581
86d62711 582.SH AVAILABILITY
601d12fb 583The sfdisk command is part of the util-linux package and is available from
d673b74e 584https://www.kernel.org/pub/linux/utils/util-linux/.