]>
Commit | Line | Data |
---|---|---|
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 |
232dc924 | 6 | .TH PARTX 8 "February 2011" "util-linux" "System Administration" |
2f2d6528 KZ |
7 | .SH NAME |
8 | partx \- | |
3ec49e9e | 9 | tell the Linux kernel about the presence and numbering of on-disk partitions |
2f2d6528 | 10 | .SH SYNOPSIS |
5b620ebd | 11 | .B partx |
c4ecaf21 DB |
12 | .RB [ \-a | \-d | \-s ] |
13 | .RB [ \-t | |
5b620ebd | 14 | .IR TYPE ] |
c4ecaf21 DB |
15 | .RB [ \-n |
16 | .IR M:N ] | |
17 | .RI [ \- ] | |
5b620ebd | 18 | .I disk |
c4ecaf21 DB |
19 | |
20 | .B partx | |
21 | .RB [ \-a | \-d | \-s ] | |
22 | .RB [ \-t | |
23 | .IR TYPE ] | |
24 | .I partition | |
25 | .RI [ disk ] | |
26 | ||
2f2d6528 | 27 | .SH DESCRIPTION |
3ec49e9e BS |
28 | Given a device or disk-image, \fBpartx\fP tries to parse the partition table and |
29 | list its contents. It optionally adds or removes partitions. | |
2f2d6528 | 30 | |
c4ecaf21 DB |
31 | The |
32 | .I disk | |
33 | argument is optional when a | |
34 | .I partition | |
3ec49e9e BS |
35 | argument is provided. To force scanning a partition as if it were a whole disk |
36 | (for example to list nested subpartitions), use the argument "-". For example: | |
c4ecaf21 DB |
37 | |
38 | .RS | |
39 | .br | |
40 | .B partx \-\-show \- /dev/sda3 | |
41 | .RE | |
42 | ||
3ec49e9e | 43 | This will see sda3 as a whole-disk rather than a partition. |
c4ecaf21 | 44 | |
3ec49e9e BS |
45 | .B This is not an fdisk program |
46 | \-\- adding and removing partitions | |
47 | does not change the disk, it just tells the kernel | |
48 | about the presence and numbering of on-disk partitions. | |
2f2d6528 KZ |
49 | |
50 | .SH OPTIONS | |
c4ecaf21 | 51 | .IP "\fB\-a, \-\-add\fP" |
3ec49e9e | 52 | Add the specified partitions, or read the disk and add all partitions. |
c4ecaf21 | 53 | .IP "\fB\-b, \-\-bytes\fP" |
3ec49e9e | 54 | Print the SIZE column in bytes rather than in human-readable format. |
c4ecaf21 | 55 | .IP "\fB\-d, \-\-delete\fP" |
3ec49e9e | 56 | Delete the specified partitions or all partitions. |
c4ecaf21 DB |
57 | .IP "\fB\-g, \-\-noheadings\fP" |
58 | Do not print a header line. | |
3ec49e9e BS |
59 | .IP "\fB\-l, \-\-list\fP" |
60 | List the partitions. Note that all numbers are in 512-byte sectors. This output | |
61 | format is DEPRECATED in favour of \fB\-\-show\fP. Don't use it in newly written | |
62 | scripts. | |
c4ecaf21 | 63 | .IP "\fB\-o, \-\-output \fIlist\fP" |
3ec49e9e BS |
64 | Define the output columns to use for \fB\-\-show\fP and \fB\-\-raw\fP output. |
65 | If no output arrangement is specified, then a default set is used. | |
66 | Use \fB\-\-help\fP to get list of all supported columns. | |
c4ecaf21 | 67 | .IP "\fB\-r, \-\-raw\fP" |
3ec49e9e | 68 | Use the raw output format. |
c4ecaf21 | 69 | .IP "\fB\-s, \-\-show\fP" |
3ec49e9e BS |
70 | List the partitions. All numbers (except SIZE) are in 512-byte sectors. The output |
71 | columns can be rearranged with the \fB\-\-output\fP option. | |
c4ecaf21 | 72 | .IP "\fB\-t, \-\-type \fItype\fP" |
3ec49e9e BS |
73 | Specify the partition table type -- aix, bsd, dos, gpt, mac, minix, sgi, solaris_x86, |
74 | sun, ultrix or unixware. | |
c4ecaf21 | 75 | .IP "\fB\-n, \-\-nr \fIM:N\fP" |
3ec49e9e BS |
76 | Specify the range of partitions. For backward compatibility also the format |
77 | <M-N> is supported. The range may contain negative | |
78 | numbers, for example "--nr :-1" means the last partition, and "--nr -2:-1" means | |
79 | the last two partitions. Supported range specifications are: | |
c4ecaf21 | 80 | .RS |
2f2d6528 | 81 | .TP |
c4ecaf21 | 82 | .B <M> |
3ec49e9e | 83 | Specifies just one partition (e.g. --nr 3). |
2f2d6528 | 84 | .TP |
c4ecaf21 | 85 | .B <M:> |
3ec49e9e | 86 | Specifies lower limit only (e.g. --nr 2:). |
2f2d6528 | 87 | .TP |
c4ecaf21 | 88 | .B <:N> |
3ec49e9e | 89 | Specifies upper limit only (e.g. --nr :4). |
c4ecaf21 DB |
90 | .TP |
91 | .B <M:N> | |
92 | or | |
93 | .B <M-N> | |
3ec49e9e | 94 | Specifies lower and upper limits (e.g. --nr 2:4). |
c4ecaf21 DB |
95 | .RE |
96 | .SH EXAMPLES | |
97 | .IP "\fBpartx \-\-show /dev/sdb3\fP" | |
98 | .IP "\fBpartx \-\-show --nr 3 /dev/sdb\fP" | |
99 | .IP "\fBpartx \-\-show /dev/sdb3 /dev/sdb\fP" | |
3ec49e9e | 100 | All three commands list partition 3 of /dev/sdb. |
c4ecaf21 | 101 | .IP "\fBpartx \-\-show \- /dev/sdb3\fP" |
3ec49e9e | 102 | Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk). |
c4ecaf21 | 103 | .IP "\fBpartx \-o START -g --nr 3 /dev/sdb\fP" |
3ec49e9e | 104 | Prints the start sector of partition 5 on /dev/sda without header. |
c4ecaf21 | 105 | .IP "\fBpartx \-o SECTORS,SIZE /dev/sda5 /dev/sda\fP" |
3ec49e9e | 106 | Lists the length in sectors and human-readable size of partition 5 on /dev/sda. |
c4ecaf21 | 107 | .IP "\fBpartx \-\-add --nr 3:5 /dev/sdd\fP" |
3ec49e9e | 108 | Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd. |
c4ecaf21 | 109 | .IP "\fBpartx \-d --nr :-1 /dev/sdd\fP" |
3ec49e9e | 110 | Removes the last partition on /dev/sdd. |
2f2d6528 KZ |
111 | |
112 | .SH SEE ALSO | |
113 | .BR addpart (8), | |
114 | .BR delpart (8), | |
115 | .BR fdisk (8), | |
116 | .BR parted (8), | |
117 | .BR partprobe (8) | |
86d62711 | 118 | |
a5db2fd6 | 119 | .SH AUTHORS |
c4ecaf21 DB |
120 | .nf |
121 | Davidlohr Bueso <dave@gnu.org> | |
122 | Karel Zak <kzak@redhat.com> | |
123 | .fi | |
124 | ||
125 | The original version was written by Andries E. Brouwer <aeb@cwi.nl>. | |
86d62711 | 126 | .SH AVAILABILITY |
601d12fb KZ |
127 | The partx command is part of the util-linux package and is available from |
128 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. |