]> git.ipfire.org Git - thirdparty/util-linux.git/blame - disk-utils/partx.8.adoc
Update fsck.8.adoc
[thirdparty/util-linux.git] / disk-utils / partx.8.adoc
CommitLineData
295b3979 1//po4a: entry man manual
c6a568fc
MB
2////
3partx.8 -- man page for partx
4Copyright 2007 Karel Zak <kzak@redhat.com>
5Copyright 2007 Red Hat, Inc.
6Copyright 2010 Davidlohr Bueso <dave@gnu.org>
7May be distributed under the GNU General Public License
8////
9= partx(8)
10:doctype: manpage
11:man manual: System Administration
12:man source: util-linux {release-version}
13:page-layout: base
14:command: partx
15
16== NAME
17
18partx - tell the kernel about the presence and numbering of on-disk partitions
19
20== SYNOPSIS
21
22*partx* [*-a*|*-d*|*-P*|*-r*|*-s*|*-u*] [*-t* _type_] [*-n* _M_:_N_] [-] _disk_
23
24*partx* [*-a*|*-d*|*-P*|*-r*|*-s*|*-u*] [*-t* _type_] _partition_ [_disk_]
25
26== DESCRIPTION
27
28Given a device or disk-image, *partx* tries to parse the partition table and list its contents. It can also tell the kernel to add or remove partitions from its bookkeeping.
29
30The _disk_ argument is optional when a _partition_ argument is provided. To force scanning a partition as if it were a whole disk (for example to list nested subpartitions), use the argument "-" (hyphen-minus). For example:
31
32____
33partx --show - /dev/sda3
34____
35
36This will see sda3 as a whole-disk rather than as a partition.
37
38*partx is not an fdisk program* - adding and removing partitions does not change the disk, it just tells the kernel about the presence and numbering of on-disk partitions.
39
40== OPTIONS
41
42*-a*, *--add*::
299604dd 43Add the specified partitions, or read the disk and add all partitions.
c6a568fc
MB
44
45*-b*, *--bytes*::
4c989ad4 46include::man-common/in-bytes.adoc[]
c6a568fc
MB
47
48*-d*, *--delete*::
299604dd 49Delete the specified partitions or all partitions. It is not error to remove non-existing partitions, so this option is possible to use together with large *--nr* ranges without care about the current partitions set on the device.
c6a568fc
MB
50
51*-g*, *--noheadings*::
299604dd 52Do not print a header line with *--show* or *--raw*.
c6a568fc
MB
53
54*-l*, *--list*::
299604dd 55List the partitions. Note that all numbers are in 512-byte sectors. This output format is DEPRECATED in favour of *--show*. Do not use it in newly written scripts.
c6a568fc
MB
56
57*-n*, *--nr* __M__**:**_N_::
299604dd
MB
58Specify the range of partitions. For backward compatibility also the format __M__**-**_N_ is supported. The range may contain negative numbers, for example *--nr -1:-1* means the last partition, and *--nr -2:-1* means the last two partitions. Supported range specifications are:
59+
60_M_;;
61Specifies just one partition (e.g. *--nr 3*).
62__M__**:**;;
63Specifies the lower limit only (e.g. *--nr 2:*).
64**:**__N__;;
65Specifies the upper limit only (e.g. *--nr :4*).
66__M__**:**_N_;;
67Specifies the lower and upper limits (e.g. *--nr 2:4*).
c6a568fc
MB
68
69*-o*, *--output* _list_::
299604dd 70Define the output columns to use for *--show*, *--pairs* and *--raw* output. If no output arrangement is specified, then a default set is used. Use *--help* to get _list_ of all supported columns. This option cannot be combined with the *--add*, *--delete*, *--update* or *--list* options.
c6a568fc
MB
71
72*--output-all*::
299604dd 73Output all available columns.
c6a568fc
MB
74
75*-P*, *--pairs*::
299604dd 76List the partitions using the KEY="value" format.
c6a568fc
MB
77
78*-r*, *--raw*::
299604dd 79List the partitions using the raw output format.
c6a568fc
MB
80
81*-s*, *--show*::
299604dd 82List the partitions. The output columns can be selected and rearranged with the *--output* option. All numbers (except SIZE) are in 512-byte sectors.
c6a568fc
MB
83
84*-t*, *--type* _type_::
299604dd 85Specify the partition table type.
c6a568fc
MB
86
87*--list-types*::
299604dd 88List supported partition types and exit.
c6a568fc
MB
89
90*-u*, *--update*::
299604dd 91Update the specified partitions.
c6a568fc
MB
92
93*-S*, *--sector-size* _size_::
299604dd 94Overwrite default sector size.
c6a568fc
MB
95
96*-v*, *--verbose*::
299604dd 97Verbose mode.
c6a568fc 98
2b2d3172 99include::man-common/help-version.adoc[]
c6a568fc
MB
100
101== ENVIRONMENT
102
103LIBBLKID_DEBUG=all::
299604dd 104enables libblkid debug output.
c6a568fc
MB
105
106== EXAMPLE
107
108partx --show /dev/sdb3::
109partx --show --nr 3 /dev/sdb::
110partx --show /dev/sdb3 /dev/sdb::
e6743239 111All three commands list partition 3 of _/dev/sdb_.
c6a568fc
MB
112
113partx --show - /dev/sdb3::
299604dd 114Lists all subpartitions on _/dev/sdb3_ (the device is used as whole-disk).
c6a568fc
MB
115
116partx -o START -g --nr 5 /dev/sdb::
299604dd 117Prints the start sector of partition 5 on _/dev/sdb_ without header.
c6a568fc
MB
118
119partx -o SECTORS,SIZE /dev/sda5 /dev/sda::
299604dd 120Lists the length in sectors and human-readable size of partition 5 on _/dev/sda_.
c6a568fc
MB
121
122partx --add --nr 3:5 /dev/sdd::
299604dd 123Adds all available partitions from 3 to 5 (inclusive) on _/dev/sdd_.
c6a568fc
MB
124
125partx -d --nr :-1 /dev/sdd::
299604dd 126Removes the last partition on _/dev/sdd_.
c6a568fc
MB
127
128== AUTHORS
129
299604dd
MB
130mailto:dave@gnu.org[Davidlohr Bueso],
131mailto:kzak@redhat.com[Karel Zak]
c6a568fc
MB
132
133The original version was written by mailto:aeb@cwi.nl[Andries E. Brouwer]
134
135== SEE ALSO
136
137*addpart*(8),
138*delpart*(8),
139*fdisk*(8),
140*parted*(8),
141*partprobe*(8)
142
625e9c61 143include::man-common/bugreports.adoc[]
c6a568fc 144
625e9c61 145include::man-common/footer.adoc[]
c6a568fc
MB
146
147ifdef::translation[]
625e9c61 148include::man-common/translation.adoc[]
c6a568fc 149endif::[]