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 SIZE column in bytes rather than in human-readable
39 format.
40
41 -d, --delete
42 Delete the specified partitions or all partitions. It is not error
43 to remove non-existing partitions, so this option is possible to
44 use together with large --nr ranges without care about the current
45 partitions set on the device.
46
47 -g, --noheadings
48 Do not print a header line with --show or --raw.
49
50 -l, --list
51 List the partitions. Note that all numbers are in 512-byte sectors.
52 This output format is DEPRECATED in favour of --show. Do not use it
53 in newly written scripts.
54
55 -n, --nr M:N
56 Specify the range of partitions. For backward compatibility also
57 the format M-N is supported. The range may contain negative
58 numbers, for example --nr -1:-1 means the last partition, and --nr
59 -2:-1 means the last two partitions. Supported range specifications
60 are:
61
62 M
63 Specifies just one partition (e.g. --nr 3).
64
65 M:
66 Specifies the lower limit only (e.g. --nr 2:).
67
68 :N
69 Specifies the upper limit only (e.g. --nr :4).
70
71 M:N
72 Specifies the lower and upper limits (e.g. --nr 2:4).
73
74 -o, --output list
75 Define the output columns to use for --show, --pairs and --raw
76 output. If no output arrangement is specified, then a default set
77 is used. Use --help to get list of all supported columns. This
78 option cannot be combined with the --add, --delete, --update or
79 --list options.
80
81 --output-all
82 Output all available columns.
83
84 -P, --pairs
85 List the partitions using the KEY="value" format.
86
87 -r, --raw
88 List the partitions using the raw output format.
89
90 -s, --show
91 List the partitions. The output columns can be selected and
92 rearranged with the --output option. All numbers (except SIZE) are
93 in 512-byte sectors.
94
95 -t, --type type
96 Specify the partition table type.
97
98 --list-types
99 List supported partition types and exit.
100
101 -u, --update
102 Update the specified partitions.
103
104 -S, --sector-size size
105 Overwrite default sector size.
106
107 -v, --verbose
108 Verbose mode.
109
110 -V, --version
111 Display version information and exit.
112
113 -h, --help
114 Display help text and exit.
115
117 LIBBLKID_DEBUG=all
118 enables libblkid debug output.
119
121 partx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show
122 /dev/sdb3 /dev/sdb
123 All three commands list partition 3 of /dev/sdb.
124
125 partx --show - /dev/sdb3
126 Lists all subpartitions on /dev/sdb3 (the device is used as
127 whole-disk).
128
129 partx -o START -g --nr 5 /dev/sdb
130 Prints the start sector of partition 5 on /dev/sdb without header.
131
132 partx -o SECTORS,SIZE /dev/sda5 /dev/sda
133 Lists the length in sectors and human-readable size of partition 5
134 on /dev/sda.
135
136 partx --add --nr 3:5 /dev/sdd
137 Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
138
139 partx -d --nr :-1 /dev/sdd
140 Removes the last partition on /dev/sdd.
141
143 Davidlohr Bueso <dave@gnu.org>, Karel Zak <kzak@redhat.com>
144
145 The original version was written by Andries E. Brouwer <aeb@cwi.nl>
146
148 addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)
149
151 For bug reports, use the issue tracker at
152 https://github.com/karelzak/util-linux/issues.
153
155 The partx command is part of the util-linux package which can be
156 downloaded from Linux Kernel Archive
157 <https://www.kernel.org/pub/linux/utils/util-linux/>.
158
159
160
161util-linux 2.37.2 2021-06-02 PARTX(8)