1PARTX(8) System Administration PARTX(8)
2
3
4
6 partx - tell the kernel about the presence and numbering of on-disk
7 partitions
8
10 partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:_N_] [-] disk
11
12 partx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]
13
15 Given a device or disk-image, partx tries to parse the partition table
16 and list its contents. It can also tell the kernel to add or remove
17 partitions from its bookkeeping.
18
19 The disk argument is optional when a partition argument is provided. To
20 force scanning a partition as if it were a whole disk (for example to
21 list nested subpartitions), use the argument "-" (hyphen-minus). For
22 example:
23
24 partx --show - /dev/sda3
25
26 This will see sda3 as a whole-disk rather than as a partition.
27
28 partx is not an fdisk program - adding and removing partitions does not
29 change the disk, it just tells the kernel about the presence and
30 numbering of on-disk partitions.
31
33 -a, --add
34 Add the specified partitions, or read the disk and add all
35 partitions.
36
37 -b, --bytes
38 Print the sizes in bytes rather than in a human-readable format.
39
40 By default, the unit, sizes are expressed in, is byte, and unit
41 prefixes are in power of 2^10 (1024). Abbreviations of symbols are
42 exhibited truncated in order to reach a better readability, by
43 exhibiting alone the first letter of them; examples: "1 KiB" and "1
44 MiB" are respectively exhibited as "1 K" and "1 M", then omitting
45 on purpose the mention "iB", which is part of these abbreviations.
46
47 -d, --delete
48 Delete the specified partitions or all partitions. It is not error
49 to remove non-existing partitions, so this option is possible to
50 use together with large --nr ranges without care about the current
51 partitions set on the device.
52
53 -g, --noheadings
54 Do not print a header line with --show or --raw.
55
56 -l, --list
57 List the partitions. Note that all numbers are in 512-byte sectors.
58 This output format is DEPRECATED in favour of --show. Do not use it
59 in newly written scripts.
60
61 -n, --nr M:N
62 Specify the range of partitions. For backward compatibility also
63 the format M-N is supported. The range may contain negative
64 numbers, for example --nr -1:-1 means the last partition, and --nr
65 -2:-1 means the last two partitions. Supported range specifications
66 are:
67
68 M
69 Specifies just one partition (e.g. --nr 3).
70
71 M:
72 Specifies the lower limit only (e.g. --nr 2:).
73
74 :N
75 Specifies the upper limit only (e.g. --nr :4).
76
77 M:N
78 Specifies the lower and upper limits (e.g. --nr 2:4).
79
80 -o, --output list
81 Define the output columns to use for --show, --pairs and --raw
82 output. If no output arrangement is specified, then a default set
83 is used. Use --help to get list of all supported columns. This
84 option cannot be combined with the --add, --delete, --update or
85 --list options.
86
87 --output-all
88 Output all available columns.
89
90 -P, --pairs
91 List the partitions using the KEY="value" format.
92
93 -r, --raw
94 List the partitions using the raw output format.
95
96 -s, --show
97 List the partitions. The output columns can be selected and
98 rearranged with the --output option. All numbers (except SIZE) are
99 in 512-byte sectors.
100
101 -t, --type type
102 Specify the partition table type.
103
104 --list-types
105 List supported partition types and exit.
106
107 -u, --update
108 Update the specified partitions.
109
110 -S, --sector-size size
111 Overwrite default sector size.
112
113 -v, --verbose
114 Verbose mode.
115
116 -h, --help
117 Display help text and exit.
118
119 -V, --version
120 Print version and exit.
121
123 LIBBLKID_DEBUG=all
124 enables libblkid debug output.
125
127 partx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show
128 /dev/sdb3 /dev/sdb
129 All three commands list partition 3 of /dev/sdb.
130
131 partx --show - /dev/sdb3
132 Lists all subpartitions on /dev/sdb3 (the device is used as
133 whole-disk).
134
135 partx -o START -g --nr 5 /dev/sdb
136 Prints the start sector of partition 5 on /dev/sdb without header.
137
138 partx -o SECTORS,SIZE /dev/sda5 /dev/sda
139 Lists the length in sectors and human-readable size of partition 5
140 on /dev/sda.
141
142 partx --add --nr 3:5 /dev/sdd
143 Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
144
145 partx -d --nr :-1 /dev/sdd
146 Removes the last partition on /dev/sdd.
147
149 Davidlohr Bueso <dave@gnu.org>, Karel Zak <kzak@redhat.com>
150
151 The original version was written by Andries E. Brouwer <aeb@cwi.nl>
152
154 addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)
155
157 For bug reports, use the issue tracker at
158 https://github.com/util-linux/util-linux/issues.
159
161 The partx command is part of the util-linux package which can be
162 downloaded from Linux Kernel Archive
163 <https://www.kernel.org/pub/linux/utils/util-linux/>.
164
165
166
167util-linux 2.38 2022-02-17 PARTX(8)