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 partx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]
12
14 Given a device or disk-image, partx tries to parse the partition table
15 and list its contents. It can also tell the kernel to add or remove
16 partitions from its bookkeeping.
17
18 The disk argument is optional when a partition argument is provided.
19 To force scanning a partition as if it were a whole disk (for example
20 to list nested subpartitions), use the argument "-" (hyphen-minus).
21 For example:
22
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 num‐
30 bering of on-disk partitions.
31
33 -a, --add
34 Add the specified partitions, or read the disk and add all par‐
35 titions.
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.
43
44 -g, --noheadings
45 Do not print a header line with --show or --raw.
46
47 -l, --list
48 List the partitions. Note that all numbers are in 512-byte sec‐
49 tors. This output format is DEPRECATED in favour of --show. Do
50 not use it in newly written scripts.
51
52 -n, --nr M:N
53 Specify the range of partitions. For backward compatibility
54 also the format M-N is supported. The range may contain nega‐
55 tive numbers, for example --nr -1:-1 means the last partition,
56 and --nr -2:-1 means the last two partitions. Supported range
57 specifications are:
58
59 M Specifies just one partition (e.g. --nr 3).
60
61 M: Specifies the lower limit only (e.g. --nr 2:).
62
63 :N Specifies the upper limit only (e.g. --nr :4).
64
65 M:N Specifies the lower and upper limits (e.g. --nr
66 2:4).
67
68 -o, --output list
69 Define the output columns to use for --show, --pairs and --raw
70 output. If no output arrangement is specified, then a default
71 set is used. Use --help to get list of all supported columns.
72 This option cannot be combined with the --add, --delete,
73 --update or --list options.
74
75 --output-all
76 Output all available columns.
77
78 -P, --pairs
79 List the partitions using the KEY="value" format.
80
81 -r, --raw
82 List the partitions using the raw output format.
83
84 -s, --show
85 List the partitions. The output columns can be selected and
86 rearranged with the --output option. All numbers (except SIZE)
87 are in 512-byte sectors.
88
89 -t, --type type
90 Specify the partition table type.
91
92 --list-types
93 List supported partition types and exit.
94
95 -u, --update
96 Update the specified partitions.
97
98 -S, --sector-size size
99 Overwrite default sector size.
100
101 -v, --verbose
102 Verbose mode.
103
104 -V, --version
105 Display version information and exit.
106
107 -h, --help
108 Display help text and exit.
109
111 partx --show /dev/sdb3
112 partx --show --nr 3 /dev/sdb
113 partx --show /dev/sdb3 /dev/sdb
114 All three commands list partition 3 of /dev/sdb.
115
116 partx --show - /dev/sdb3
117 Lists all subpartitions on /dev/sdb3 (the device is used as
118 whole-disk).
119
120 partx -o START -g --nr 5 /dev/sdb
121 Prints the start sector of partition 5 on /dev/sdb without
122 header.
123
124 partx -o SECTORS,SIZE /dev/sda5 /dev/sda
125 Lists the length in sectors and human-readable size of partition
126 5 on /dev/sda.
127
128 partx --add --nr 3:5 /dev/sdd
129 Adds all available partitions from 3 to 5 (inclusive) on
130 /dev/sdd.
131
132 partx -d --nr :-1 /dev/sdd
133 Removes the last partition on /dev/sdd.
134
136 addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)
137
139 Davidlohr Bueso ⟨dave@gnu.org⟩
140 Karel Zak ⟨kzak@redhat.com⟩
141
142 The original version was written by Andries E. Brouwer ⟨aeb@cwi.nl⟩.
143
145 LIBBLKID_DEBUG=all
146 enables libblkid debug output.
147
149 The partx command is part of the util-linux package and is available
150 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
151 linux/⟩.
152
153
154
155util-linux December 2014 PARTX(8)