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 -P, --pairs
76 List the partitions using the KEY="value" format.
77
78 -r, --raw
79 List the partitions using the raw output format.
80
81 -s, --show
82 List the partitions. The output columns can be selected and
83 rearranged with the --output option. All numbers (except SIZE)
84 are in 512-byte sectors.
85
86 -t, --type type
87 Specify the partition table type.
88
89 --list-types
90 List supported partition types and exit.
91
92 -u, --update
93 Update the specified partitions.
94
95 -S, --sector-size size
96 Overwrite default sector size.
97
98 -v, --verbose
99 Verbose mode.
100
101 -V, --version
102 Display version information and exit.
103
104 -h, --help
105 Display help text and exit.
106
108 partx --show /dev/sdb3
109 partx --show --nr 3 /dev/sdb
110 partx --show /dev/sdb3 /dev/sdb
111 All three commands list partition 3 of /dev/sdb.
112
113 partx --show - /dev/sdb3
114 Lists all subpartitions on /dev/sdb3 (the device is used as
115 whole-disk).
116
117 partx -o START -g --nr 5 /dev/sdb
118 Prints the start sector of partition 5 on /dev/sdb without
119 header.
120
121 partx -o SECTORS,SIZE /dev/sda5 /dev/sda
122 Lists the length in sectors and human-readable size of partition
123 5 on /dev/sda.
124
125 partx --add --nr 3:5 /dev/sdd
126 Adds all available partitions from 3 to 5 (inclusive) on
127 /dev/sdd.
128
129 partx -d --nr :-1 /dev/sdd
130 Removes the last partition on /dev/sdd.
131
133 addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)
134
136 Davidlohr Bueso ⟨dave@gnu.org⟩
137 Karel Zak ⟨kzak@redhat.com⟩
138
139 The original version was written by Andries E. Brouwer ⟨aeb@cwi.nl⟩.
140
142 LIBBLKID_DEBUG=all
143 enables libblkid debug output.
144
146 The partx command is part of the util-linux package and is available
147 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
148 linux/⟩.
149
150
151
152util-linux December 2014 PARTX(8)