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