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
6 .TH PARTX "8" "June 2012" "util-linux" "System Administration"
8 partx \- tell the Linux kernel about the presence and numbering of
11 partx [\-a|\-d|\-s|\-u] [\-t TYPE] [\-n M:N] [\-] disk
13 partx [\-a|\-d|\-s|\-u] [\-t TYPE] partition [disk]
15 Given a device or disk-image,
17 tries to parse the partition table and list its contents. It
18 optionally adds or removes partitions.
22 argument is optional when a
24 argument is provided. To force scanning a partition as if it were a whole disk
25 (for example to list nested subpartitions), use the argument "-". For example:
29 partx \-\-show \- /dev/sda3
32 This will see sda3 as a whole-disk rather than a partition.
35 .B partx is not an fdisk program
36 \-\- adding and removing partitions does not change the disk, it just
37 tells the kernel about the presence and numbering of on-disk
40 .IP "\fB\-a\fR, \fB\-\-add\fP"
41 Add the specified partitions, or read the disk and add all partitions.
42 .IP "\fB\-b\fR, \fB\-\-bytes\fP"
43 Print the SIZE column in bytes rather than in human-readable format.
44 .IP "\fB\-d\fR, \fB\-\-delete\fP"
45 Delete the specified partitions or all partitions.
46 .IP "\fB\-u\fR, \fB\-\-update\fP"
47 Update the specified partitions.
48 .IP "\fB\-g\fR, \fB\-\-noheadings\fP"
49 Do not print a header line.
50 .IP "\fB\-h\fR, \fB\-\-help\fP"
51 Display help text and exit.
52 .IP "\fB\-l\fR, \fB\-\-list\fP"
53 List the partitions. Note that all numbers are in 512-byte sectors.
54 This output format is DEPRECATED in favour of
56 Do not use it in newly written scripts.
57 .IP "\fB\-o\fR, \fB\-\-output \fIlist\fP"
58 Define the output columns to use for
62 output. If no output arrangement is specified, then a default set is
67 of all supported columns. This option cannot be combined with
73 .IP "\fB\-P\fR, \fB\-\-pairs\fP"
74 Output using key="value" format.
75 .IP "\fB\-n\fR, \fB\-\-nr \fIM:N\fP"
76 Specify the range of partitions. For backward compatibility also the
79 is supported. The range may contain negative numbers, for example
81 means the last partition, and
83 means the last two partitions. Supported range specifications are:
87 Specifies just one partition (e.g. \fB\-\-nr\fR
91 Specifies lower limit only (e.g. \fB\-\-nr\fR
95 Specifies upper limit only (e.g. \fB\-\-nr\fR
101 Specifies lower and upper limits (e.g. \fB--nr\fR
104 .IP "\fB\-r\fR, \fB\-\-raw\fP"
105 Use the raw output format.
106 .IP "\fB\-s\fR, \fB\-\-show\fP"
107 List the partitions. All numbers (except SIZE) are in 512-byte
108 sectors. The output columns can be rearranged with the
111 .IP "\fB\-t\fR, \fB\-\-type \fItype\fP"
112 Specify the partition table type
125 .IP "\fB\-v\fR, \fB\-\-verbose\fP"
129 partx \-\-show /dev/sdb3
131 partx \-\-show --nr 3 /dev/sdb
133 partx \-\-show /dev/sdb3 /dev/sdb
134 All three commands list partition 3 of /dev/sdb.
136 partx \-\-show \- /dev/sdb3
137 Lists all subpartitions on /dev/sdb3 (the device is used as
140 partx \-o START -g --nr 5 /dev/sdb
141 Prints the start sector of partition 5 on /dev/sdb without header.
143 partx \-o SECTORS,SIZE /dev/sda5 /dev/sda
144 Lists the length in sectors and human-readable size of partition 5 on
147 partx \-\-add --nr 3:5 /dev/sdd
148 Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
150 partx \-d --nr :-1 /dev/sdd
151 Removes the last partition on /dev/sdd.
167 The original version was written by
172 .IP LIBBLKID_DEBUG=0xffff
173 enables debug output.
175 The partx command is part of the util-linux package and is available from
176 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/