]>
Commit | Line | Data |
---|---|---|
295b3979 | 1 | //po4a: entry man manual |
c6a568fc MB |
2 | //// |
3 | partx.8 -- man page for partx | |
4 | Copyright 2007 Karel Zak <kzak@redhat.com> | |
5 | Copyright 2007 Red Hat, Inc. | |
6 | Copyright 2010 Davidlohr Bueso <dave@gnu.org> | |
7 | May 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 | ||
18 | partx - 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 | ||
28 | Given 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 | ||
30 | The _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 | ____ | |
33 | partx --show - /dev/sda3 | |
34 | ____ | |
35 | ||
36 | This 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 | 43 | Add the specified partitions, or read the disk and add all partitions. |
c6a568fc MB |
44 | |
45 | *-b*, *--bytes*:: | |
4c989ad4 | 46 | include::man-common/in-bytes.adoc[] |
c6a568fc MB |
47 | |
48 | *-d*, *--delete*:: | |
299604dd | 49 | Delete 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 | 52 | Do not print a header line with *--show* or *--raw*. |
c6a568fc MB |
53 | |
54 | *-l*, *--list*:: | |
299604dd | 55 | List 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 |
58 | Specify 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_;; | |
61 | Specifies just one partition (e.g. *--nr 3*). | |
62 | __M__**:**;; | |
63 | Specifies the lower limit only (e.g. *--nr 2:*). | |
64 | **:**__N__;; | |
65 | Specifies the upper limit only (e.g. *--nr :4*). | |
66 | __M__**:**_N_;; | |
67 | Specifies the lower and upper limits (e.g. *--nr 2:4*). | |
c6a568fc MB |
68 | |
69 | *-o*, *--output* _list_:: | |
299604dd | 70 | Define 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 | 73 | Output all available columns. |
c6a568fc MB |
74 | |
75 | *-P*, *--pairs*:: | |
299604dd | 76 | List the partitions using the KEY="value" format. |
c6a568fc MB |
77 | |
78 | *-r*, *--raw*:: | |
299604dd | 79 | List the partitions using the raw output format. |
c6a568fc MB |
80 | |
81 | *-s*, *--show*:: | |
299604dd | 82 | List 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 | 85 | Specify the partition table type. |
c6a568fc MB |
86 | |
87 | *--list-types*:: | |
299604dd | 88 | List supported partition types and exit. |
c6a568fc MB |
89 | |
90 | *-u*, *--update*:: | |
299604dd | 91 | Update the specified partitions. |
c6a568fc MB |
92 | |
93 | *-S*, *--sector-size* _size_:: | |
299604dd | 94 | Overwrite default sector size. |
c6a568fc MB |
95 | |
96 | *-v*, *--verbose*:: | |
299604dd | 97 | Verbose mode. |
c6a568fc | 98 | |
2b2d3172 | 99 | include::man-common/help-version.adoc[] |
c6a568fc MB |
100 | |
101 | == ENVIRONMENT | |
102 | ||
103 | LIBBLKID_DEBUG=all:: | |
299604dd | 104 | enables libblkid debug output. |
c6a568fc MB |
105 | |
106 | == EXAMPLE | |
107 | ||
108 | partx --show /dev/sdb3:: | |
109 | partx --show --nr 3 /dev/sdb:: | |
110 | partx --show /dev/sdb3 /dev/sdb:: | |
e6743239 | 111 | All three commands list partition 3 of _/dev/sdb_. |
c6a568fc MB |
112 | |
113 | partx --show - /dev/sdb3:: | |
299604dd | 114 | Lists all subpartitions on _/dev/sdb3_ (the device is used as whole-disk). |
c6a568fc MB |
115 | |
116 | partx -o START -g --nr 5 /dev/sdb:: | |
299604dd | 117 | Prints the start sector of partition 5 on _/dev/sdb_ without header. |
c6a568fc MB |
118 | |
119 | partx -o SECTORS,SIZE /dev/sda5 /dev/sda:: | |
299604dd | 120 | Lists the length in sectors and human-readable size of partition 5 on _/dev/sda_. |
c6a568fc MB |
121 | |
122 | partx --add --nr 3:5 /dev/sdd:: | |
299604dd | 123 | Adds all available partitions from 3 to 5 (inclusive) on _/dev/sdd_. |
c6a568fc MB |
124 | |
125 | partx -d --nr :-1 /dev/sdd:: | |
299604dd | 126 | Removes the last partition on _/dev/sdd_. |
c6a568fc MB |
127 | |
128 | == AUTHORS | |
129 | ||
299604dd MB |
130 | mailto:dave@gnu.org[Davidlohr Bueso], |
131 | mailto:kzak@redhat.com[Karel Zak] | |
c6a568fc MB |
132 | |
133 | The 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 | 143 | include::man-common/bugreports.adoc[] |
c6a568fc | 144 | |
625e9c61 | 145 | include::man-common/footer.adoc[] |
c6a568fc MB |
146 | |
147 | ifdef::translation[] | |
625e9c61 | 148 | include::man-common/translation.adoc[] |
c6a568fc | 149 | endif::[] |