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