1 .\" partx.8 -- man page for partx
2 .\" Copyright 2007 Karel Zak <kzak@redhat.com>
3 .\" Copyright 2007 Red Hat, Inc.
4 .\" Copyright 2010 Davidlohr Bueso <dave@gnu.org>
5 .\" May be distributed under the GNU General Public License
7 .TH PARTX "8" "December 2014" "util-linux" "System Administration"
9 partx \- tell the kernel about the presence and numbering of on-disk partitions
12 .RB [ \-a | \-d | \-P | \-r | \-s | \-u ]
13 .RB [ \-t " \fItype\fR]"
14 .RB [ \-n " \fIM" : \fIN\fR]
18 .RB [ \-a | \-d | \-P | \-r | \-s | \-u ]
19 .RB [ \-t " \fItype\fR]"
20 .IR partition " [" disk ]
22 Given a device or disk-image,
24 tries to parse the partition table and list its contents. It
25 can also tell the kernel to add or remove partitions from its
30 argument is optional when a
32 argument is provided. To force scanning a partition as if it were a whole disk
33 (for example to list nested subpartitions), use the argument "\-" (hyphen-minus).
38 partx \-\-show \- /dev/sda3
41 This will see sda3 as a whole-disk rather than as a partition.
43 .B partx is not an fdisk program
44 \(en adding and removing partitions does not change the disk, it just
45 tells the kernel about the presence and numbering of on-disk
50 Add the specified partitions, or read the disk and add all partitions.
52 .BR \-b , " \-\-bytes"
53 Print the SIZE column in bytes rather than in human-readable format.
55 .BR \-d , " \-\-delete"
56 Delete the specified partitions or all partitions. It is not error to
57 remove non-existing partitions, so this option is possible to use together with
58 large \fB\-\-nr\fR ranges without care about the current partitions set on
61 .BR \-g , " \-\-noheadings"
62 Do not print a header line with \fB\-\-show\fR or \fB\-\-raw\fR.
65 List the partitions. Note that all numbers are in 512-byte sectors.
66 This output format is DEPRECATED in favour of
68 Do not use it in newly written scripts.
70 .BR \-n , " \-\-nr " \fIM : \fIN
71 Specify the range of partitions. For backward compatibility also the
72 format \fIM\fB\-\fIN\fR is supported.
73 The range may contain negative numbers, for example
75 means the last partition, and
77 means the last two partitions. Supported range specifications are:
81 Specifies just one partition (e.g.\& \fB\-\-nr 3\fR).
84 Specifies the lower limit only (e.g.\& \fB\-\-nr 2:\fR).
87 Specifies the upper limit only (e.g.\& \fB\-\-nr :4\fR).
90 Specifies the lower and upper limits (e.g.\& \fB\-\-nr 2:4\fR).
93 .BR \-o , " \-\-output " \fIlist
94 Define the output columns to use for
99 output. If no output arrangement is specified, then a default set is
104 of all supported columns. This option cannot be combined with the
113 Output all available columns.
115 .BR \-P , " \-\-pairs"
116 List the partitions using the KEY="value" format.
119 List the partitions using the raw output format.
121 .BR \-s , " \-\-show"
123 The output columns can be selected and rearranged with the
124 \fB\-\-output\fR option.
125 All numbers (except SIZE) are in 512-byte sectors.
127 .BR \-t , " \-\-type " \fItype
128 Specify the partition table type.
131 List supported partition types and exit.
133 .BR \-u , " \-\-update"
134 Update the specified partitions.
136 .BR \-S , " \-\-sector\-size " \fIsize
137 Overwrite default sector size.
139 .BR \-v , " \-\-verbose"
142 .BR \-V , " \-\-version"
143 Display version information and exit.
145 .BR \-h , " \-\-help"
146 Display help text and exit.
149 partx \-\-show /dev/sdb3
151 partx \-\-show \-\-nr 3 /dev/sdb
153 partx \-\-show /dev/sdb3 /dev/sdb
154 All three commands list partition 3 of /dev/sdb.
156 partx \-\-show \- /dev/sdb3
157 Lists all subpartitions on /dev/sdb3 (the device is used as
160 partx \-o START \-g \-\-nr 5 /dev/sdb
161 Prints the start sector of partition 5 on /dev/sdb without header.
163 partx \-o SECTORS,SIZE /dev/sda5 /dev/sda
164 Lists the length in sectors and human-readable size of partition 5 on
167 partx \-\-add \-\-nr 3:5 /dev/sdd
168 Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
170 partx \-d \-\-nr :\-1 /dev/sdd
171 Removes the last partition on /dev/sdd.
187 The original version was written by
192 .IP LIBBLKID_DEBUG=all
193 enables libblkid debug output.
195 The partx command is part of the util-linux package and is available from
196 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/