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