]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/partx.8
Merge branch 'bash-completion' of git://github.com/kerolasa/lelux-utiliteetit
[thirdparty/util-linux.git] / disk-utils / partx.8
1 .\" partx.8 -- man page for partx
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 .\"
7 .TH PARTX "8" "December 2014" "util-linux" "System Administration"
8 .SH NAME
9 partx \- tell the kernel about the presence and numbering of on-disk partitions
10 .SH SYNOPSIS
11 .B partx
12 .RB [ \-a | \-d | \-P | \-r | \-s | \-u ]
13 .RB [ \-t " \fItype\fR]"
14 .RB [ \-n " \fIM" : \fIN\fR]
15 .RB [ \- "] " \fIdisk
16 .br
17 .B partx
18 .RB [ \-a | \-d | \-P | \-r | \-s | \-u ]
19 .RB [ \-t " \fItype\fR]"
20 .IR partition " [" disk ]
21 .SH DESCRIPTION
22 Given a device or disk-image,
23 .B partx
24 tries to parse the partition table and list its contents. It
25 can also tell the kernel to add or remove partitions from its
26 bookkeeping.
27 .PP
28 The
29 .I disk
30 argument is optional when a
31 .I partition
32 argument is provided. To force scanning a partition as if it were a whole disk
33 (for example to list nested subpartitions), use the argument "\-" (hyphen-minus).
34 For example:
35
36 .RS 7
37 .TP
38 partx \-\-show \- /dev/sda3
39 .RE
40 .PP
41 This will see sda3 as a whole-disk rather than as a partition.
42 .PP
43 .B partx is not an fdisk program
44 \(en adding and removing partitions does not change the disk, it just
45 tells the kernel about the presence and numbering of on-disk
46 partitions.
47 .SH OPTIONS
48 .TP
49 .BR \-a , " \-\-add"
50 Add the specified partitions, or read the disk and add all partitions.
51 .TP
52 .BR \-b , " \-\-bytes"
53 Print the SIZE column in bytes rather than in human-readable format.
54 .TP
55 .BR \-d , " \-\-delete"
56 Delete the specified partitions or all partitions.
57 .TP
58 .BR \-g , " \-\-noheadings"
59 Do not print a header line with \fB\-\-show\fR or \fB\-\-raw\fR.
60 .TP
61 .BR \-l , " \-\-list"
62 List the partitions. Note that all numbers are in 512-byte sectors.
63 This output format is DEPRECATED in favour of
64 .BR \-\-show .
65 Do not use it in newly written scripts.
66 .TP
67 .BR \-n , " \-\-nr " \fIM : \fIN
68 Specify the range of partitions. For backward compatibility also the
69 format \fIM\fB\-\fIN\fR is supported.
70 The range may contain negative numbers, for example
71 .B \-\-nr \-1:\-1
72 means the last partition, and
73 .B \-\-nr \-2:\-1
74 means the last two partitions. Supported range specifications are:
75 .RS 14
76 .TP
77 .I M
78 Specifies just one partition (e.g.\& \fB\-\-nr 3\fR).
79 .TP
80 .IB M :
81 Specifies the lower limit only (e.g.\& \fB\-\-nr 2:\fR).
82 .TP
83 .BI : N
84 Specifies the upper limit only (e.g.\& \fB\-\-nr :4\fR).
85 .TP
86 .IB M : N
87 Specifies the lower and upper limits (e.g.\& \fB\-\-nr 2:4\fR).
88 .RE
89 .TP
90 .BR \-o , " \-\-output " \fIlist
91 Define the output columns to use for
92 .BR \-\-show ,
93 .B \-\-pairs
94 and
95 .B \-\-raw
96 output. If no output arrangement is specified, then a default set is
97 used. Use
98 .B \-\-help
99 to get
100 .I list
101 of all supported columns. This option cannot be combined with the
102 .BR \-\-add ,
103 .BR \-\-delete ,
104 .BR \-\-update
105 or
106 .B \-\-list
107 options.
108 .TP
109 .BR \-P , " \-\-pairs"
110 List the partitions using the KEY="value" format.
111 .TP
112 .BR \-r , " \-\-raw"
113 List the partitions using the raw output format.
114 .TP
115 .BR \-s , " \-\-show"
116 List the partitions.
117 The output columns can be selected and rearranged with the
118 \fB\-\-output\fR option.
119 All numbers (except SIZE) are in 512-byte sectors.
120 .TP
121 .BR \-t , " \-\-type " \fItype
122 Specify the partition table type, which can be one of
123 .BR aix ,
124 .BR bsd ,
125 .BR dos ,
126 .BR gpt ,
127 .BR mac ,
128 .BR minix ,
129 .BR PMBR ,
130 .BR sgi ,
131 .BR solaris ,
132 .BR sun ,
133 .BR ultrix ,
134 or
135 .BR unixware .
136 .TP
137 .BR \-u , " \-\-update"
138 Update the specified partitions.
139 .TP
140 .BR \-S , " \-\-sector\-size " \fIsize
141 Overwrite default sector size.
142 .TP
143 .BR \-v , " \-\-verbose"
144 Verbose mode.
145 .TP
146 .BR \-V , " \-\-version"
147 Display version information and exit.
148 .TP
149 .BR \-h , " \-\-help"
150 Display help text and exit.
151 .SH EXAMPLES
152 .TP
153 partx \-\-show /dev/sdb3
154 .TQ
155 partx \-\-show \-\-nr 3 /dev/sdb
156 .TQ
157 partx \-\-show /dev/sdb3 /dev/sdb
158 All three commands list partition 3 of /dev/sdb.
159 .TP
160 partx \-\-show \- /dev/sdb3
161 Lists all subpartitions on /dev/sdb3 (the device is used as
162 whole-disk).
163 .TP
164 partx \-o START \-g \-\-nr 5 /dev/sdb
165 Prints the start sector of partition 5 on /dev/sdb without header.
166 .TP
167 partx \-o SECTORS,SIZE /dev/sda5 /dev/sda
168 Lists the length in sectors and human-readable size of partition 5 on
169 /dev/sda.
170 .TP
171 partx \-\-add \-\-nr 3:5 /dev/sdd
172 Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
173 .TP
174 partx \-d \-\-nr :\-1 /dev/sdd
175 Removes the last partition on /dev/sdd.
176 .SH SEE ALSO
177 .BR addpart (8),
178 .BR delpart (8),
179 .BR fdisk (8),
180 .BR parted (8),
181 .BR partprobe (8)
182 .SH AUTHORS
183 .MT dave@gnu.org
184 Davidlohr Bueso
185 .ME
186 .br
187 .MT kzak@redhat.com
188 Karel Zak
189 .ME
190 .PP
191 The original version was written by
192 .MT aeb@cwi.nl
193 Andries E.\& Brouwer
194 .ME .
195 .SH ENVIRONMENT
196 .IP LIBBLKID_DEBUG=all
197 enables libblkid debug output.
198 .SH AVAILABILITY
199 The partx command is part of the util-linux package and is available from
200 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
201 Linux Kernel Archive
202 .UE .