]> git.ipfire.org Git - thirdparty/util-linux.git/blame - partx/partx.8
partx: don't print error when partition already doesn't exist
[thirdparty/util-linux.git] / partx / 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
232dc924 6.TH PARTX 8 "February 2011" "util-linux" "System Administration"
2f2d6528
KZ
7.SH NAME
8partx \-
3ec49e9e 9tell 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
28Given a device or disk-image, \fBpartx\fP tries to parse the partition table and
29list its contents. It optionally adds or removes partitions.
2f2d6528 30
c4ecaf21
DB
31The
32.I disk
33argument is optional when a
34.I partition
3ec49e9e
BS
35argument 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 43This 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
47does not change the disk, it just tells the kernel
48about the presence and numbering of on-disk partitions.
2f2d6528
KZ
49
50.SH OPTIONS
c4ecaf21 51.IP "\fB\-a, \-\-add\fP"
3ec49e9e 52Add the specified partitions, or read the disk and add all partitions.
c4ecaf21 53.IP "\fB\-b, \-\-bytes\fP"
3ec49e9e 54Print the SIZE column in bytes rather than in human-readable format.
c4ecaf21 55.IP "\fB\-d, \-\-delete\fP"
3ec49e9e 56Delete the specified partitions or all partitions.
c4ecaf21
DB
57.IP "\fB\-g, \-\-noheadings\fP"
58Do not print a header line.
3ec49e9e
BS
59.IP "\fB\-l, \-\-list\fP"
60List the partitions. Note that all numbers are in 512-byte sectors. This output
61format is DEPRECATED in favour of \fB\-\-show\fP. Don't use it in newly written
62scripts.
c4ecaf21 63.IP "\fB\-o, \-\-output \fIlist\fP"
3ec49e9e
BS
64Define the output columns to use for \fB\-\-show\fP and \fB\-\-raw\fP output.
65If no output arrangement is specified, then a default set is used.
66Use \fB\-\-help\fP to get list of all supported columns.
c4ecaf21 67.IP "\fB\-r, \-\-raw\fP"
3ec49e9e 68Use the raw output format.
c4ecaf21 69.IP "\fB\-s, \-\-show\fP"
3ec49e9e
BS
70List the partitions. All numbers (except SIZE) are in 512-byte sectors. The output
71columns can be rearranged with the \fB\-\-output\fP option.
c4ecaf21 72.IP "\fB\-t, \-\-type \fItype\fP"
3ec49e9e
BS
73Specify the partition table type -- aix, bsd, dos, gpt, mac, minix, sgi, solaris_x86,
74sun, ultrix or unixware.
c4ecaf21 75.IP "\fB\-n, \-\-nr \fIM:N\fP"
3ec49e9e
BS
76Specify the range of partitions. For backward compatibility also the format
77<M-N> is supported. The range may contain negative
78numbers, for example "--nr :-1" means the last partition, and "--nr -2:-1" means
79the last two partitions. Supported range specifications are:
c4ecaf21 80.RS
2f2d6528 81.TP
c4ecaf21 82.B <M>
3ec49e9e 83Specifies just one partition (e.g. --nr 3).
2f2d6528 84.TP
c4ecaf21 85.B <M:>
3ec49e9e 86Specifies lower limit only (e.g. --nr 2:).
2f2d6528 87.TP
c4ecaf21 88.B <:N>
3ec49e9e 89Specifies upper limit only (e.g. --nr :4).
c4ecaf21
DB
90.TP
91.B <M:N>
92or
93.B <M-N>
3ec49e9e 94Specifies 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 100All three commands list partition 3 of /dev/sdb.
c4ecaf21 101.IP "\fBpartx \-\-show \- /dev/sdb3\fP"
3ec49e9e 102Lists 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 104Prints the start sector of partition 5 on /dev/sda without header.
c4ecaf21 105.IP "\fBpartx \-o SECTORS,SIZE /dev/sda5 /dev/sda\fP"
3ec49e9e 106Lists 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 108Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
c4ecaf21 109.IP "\fBpartx \-d --nr :-1 /dev/sdd\fP"
3ec49e9e 110Removes 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
121Davidlohr Bueso <dave@gnu.org>
122Karel Zak <kzak@redhat.com>
123.fi
124
125The original version was written by Andries E. Brouwer <aeb@cwi.nl>.
86d62711 126.SH AVAILABILITY
601d12fb
KZ
127The partx command is part of the util-linux package and is available from
128ftp://ftp.kernel.org/pub/linux/utils/util-linux/.