2007-02-09 12:15:23 -06:00
|
|
|
.\" partx.8 --
|
|
|
|
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
|
|
|
|
.\" Copyright 2007 Red Hat, Inc.
|
2010-12-09 14:54:17 -06:00
|
|
|
.\" Copyright 2010 Davidlohr Bueso <dave@gnu.org>
|
2007-02-09 12:15:23 -06:00
|
|
|
.\" May be distributed under the GNU General Public License
|
2011-08-18 15:18:34 -05:00
|
|
|
.TH PARTX 8 "February 2011" "util-linux" "System Administration"
|
2007-02-09 12:15:23 -06:00
|
|
|
.SH NAME
|
|
|
|
partx \-
|
2011-02-01 05:11:47 -06:00
|
|
|
tell the Linux kernel about the presence and numbering of on-disk partitions
|
2007-02-09 12:15:23 -06:00
|
|
|
.SH SYNOPSIS
|
2009-07-22 04:29:05 -05:00
|
|
|
.B partx
|
2010-12-09 14:54:17 -06:00
|
|
|
.RB [ \-a | \-d | \-s ]
|
|
|
|
.RB [ \-t
|
2009-07-22 04:29:05 -05:00
|
|
|
.IR TYPE ]
|
2010-12-09 14:54:17 -06:00
|
|
|
.RB [ \-n
|
|
|
|
.IR M:N ]
|
|
|
|
.RI [ \- ]
|
2009-07-22 04:29:05 -05:00
|
|
|
.I disk
|
2010-12-09 14:54:17 -06:00
|
|
|
|
|
|
|
.B partx
|
|
|
|
.RB [ \-a | \-d | \-s ]
|
|
|
|
.RB [ \-t
|
|
|
|
.IR TYPE ]
|
|
|
|
.I partition
|
|
|
|
.RI [ disk ]
|
|
|
|
|
2007-02-09 12:15:23 -06:00
|
|
|
.SH DESCRIPTION
|
2011-02-01 05:11:47 -06:00
|
|
|
Given a device or disk-image, \fBpartx\fP tries to parse the partition table and
|
|
|
|
list its contents. It optionally adds or removes partitions.
|
2007-02-09 12:15:23 -06:00
|
|
|
|
2010-12-09 14:54:17 -06:00
|
|
|
The
|
|
|
|
.I disk
|
|
|
|
argument is optional when a
|
|
|
|
.I partition
|
2011-02-01 05:11:47 -06:00
|
|
|
argument is provided. To force scanning a partition as if it were a whole disk
|
|
|
|
(for example to list nested subpartitions), use the argument "-". For example:
|
2010-12-09 14:54:17 -06:00
|
|
|
|
|
|
|
.RS
|
|
|
|
.br
|
|
|
|
.B partx \-\-show \- /dev/sda3
|
|
|
|
.RE
|
|
|
|
|
2011-02-01 05:11:47 -06:00
|
|
|
This will see sda3 as a whole-disk rather than a partition.
|
2010-12-09 14:54:17 -06:00
|
|
|
|
2011-02-01 05:11:47 -06:00
|
|
|
.B This 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.
|
2007-02-09 12:15:23 -06:00
|
|
|
|
|
|
|
.SH OPTIONS
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-a, \-\-add\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Add the specified partitions, or read the disk and add all partitions.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-b, \-\-bytes\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Print the SIZE column in bytes rather than in human-readable format.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-d, \-\-delete\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Delete the specified partitions or all partitions.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-g, \-\-noheadings\fP"
|
|
|
|
Do not print a header line.
|
2011-02-01 05:11:47 -06:00
|
|
|
.IP "\fB\-l, \-\-list\fP"
|
|
|
|
List the partitions. Note that all numbers are in 512-byte sectors. This output
|
|
|
|
format is DEPRECATED in favour of \fB\-\-show\fP. Don't use it in newly written
|
|
|
|
scripts.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-o, \-\-output \fIlist\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Define the output columns to use for \fB\-\-show\fP and \fB\-\-raw\fP output.
|
|
|
|
If no output arrangement is specified, then a default set is used.
|
|
|
|
Use \fB\-\-help\fP to get list of all supported columns.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-r, \-\-raw\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Use the raw output format.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-s, \-\-show\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
List the partitions. All numbers (except SIZE) are in 512-byte sectors. The output
|
|
|
|
columns can be rearranged with the \fB\-\-output\fP option.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-t, \-\-type \fItype\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Specify the partition table type -- aix, bsd, dos, gpt, mac, minix, sgi, solaris_x86,
|
|
|
|
sun, ultrix or unixware.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fB\-n, \-\-nr \fIM:N\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
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" means the last partition, and "--nr -2:-1" means
|
|
|
|
the last two partitions. Supported range specifications are:
|
2010-12-09 14:54:17 -06:00
|
|
|
.RS
|
2007-02-09 12:15:23 -06:00
|
|
|
.TP
|
2010-12-09 14:54:17 -06:00
|
|
|
.B <M>
|
2011-02-01 05:11:47 -06:00
|
|
|
Specifies just one partition (e.g. --nr 3).
|
2007-02-09 12:15:23 -06:00
|
|
|
.TP
|
2010-12-09 14:54:17 -06:00
|
|
|
.B <M:>
|
2011-02-01 05:11:47 -06:00
|
|
|
Specifies lower limit only (e.g. --nr 2:).
|
2007-02-09 12:15:23 -06:00
|
|
|
.TP
|
2010-12-09 14:54:17 -06:00
|
|
|
.B <:N>
|
2011-02-01 05:11:47 -06:00
|
|
|
Specifies upper limit only (e.g. --nr :4).
|
2010-12-09 14:54:17 -06:00
|
|
|
.TP
|
|
|
|
.B <M:N>
|
|
|
|
or
|
|
|
|
.B <M-N>
|
2011-02-01 05:11:47 -06:00
|
|
|
Specifies lower and upper limits (e.g. --nr 2:4).
|
2010-12-09 14:54:17 -06:00
|
|
|
.RE
|
|
|
|
.SH EXAMPLES
|
|
|
|
.IP "\fBpartx \-\-show /dev/sdb3\fP"
|
|
|
|
.IP "\fBpartx \-\-show --nr 3 /dev/sdb\fP"
|
|
|
|
.IP "\fBpartx \-\-show /dev/sdb3 /dev/sdb\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
All three commands list partition 3 of /dev/sdb.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fBpartx \-\-show \- /dev/sdb3\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk).
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fBpartx \-o START -g --nr 3 /dev/sdb\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Prints the start sector of partition 5 on /dev/sda without header.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fBpartx \-o SECTORS,SIZE /dev/sda5 /dev/sda\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Lists the length in sectors and human-readable size of partition 5 on /dev/sda.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fBpartx \-\-add --nr 3:5 /dev/sdd\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
|
2010-12-09 14:54:17 -06:00
|
|
|
.IP "\fBpartx \-d --nr :-1 /dev/sdd\fP"
|
2011-02-01 05:11:47 -06:00
|
|
|
Removes the last partition on /dev/sdd.
|
2007-02-09 12:15:23 -06:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR addpart (8),
|
|
|
|
.BR delpart (8),
|
|
|
|
.BR fdisk (8),
|
|
|
|
.BR parted (8),
|
|
|
|
.BR partprobe (8)
|
2007-07-02 18:17:04 -05:00
|
|
|
|
2010-12-23 08:55:23 -06:00
|
|
|
.SH AUTHORS
|
2010-12-09 14:54:17 -06:00
|
|
|
.nf
|
|
|
|
Davidlohr Bueso <dave@gnu.org>
|
|
|
|
Karel Zak <kzak@redhat.com>
|
|
|
|
.fi
|
|
|
|
|
|
|
|
The original version was written by Andries E. Brouwer <aeb@cwi.nl>.
|
2007-07-02 18:17:04 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The partx command is part of the util-linux package and is available from
|
|
|
|
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
|