man-pages/man8/partx.8.html
2021-03-31 01:06:50 +01:00

300 lines
6.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of PARTX</TITLE>
</HEAD><BODY>
<H1>PARTX</H1>
Section: System Administration (8)<BR>Updated: December 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
partx - tell the kernel about the presence and numbering of on-disk partitions
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>partx</B>
[<B>-a</B>|<B>-d</B>|<B>-P</B>|<B>-r</B>|<B>-s</B>|<B>-u</B>]
[<B>-t</B> <I>type</I>]
[<B>-n</B> <I>M</I><B>:</B><I>N</I>]
[<B>-</B>] <B></B><I>disk</I>
<BR>
<B>partx</B>
[<B>-a</B>|<B>-d</B>|<B>-P</B>|<B>-r</B>|<B>-s</B>|<B>-u</B>]
[<B>-t</B> <I>type</I>]
<I>partition</I> [<I>disk</I>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Given a device or disk-image,
<B>partx</B>
tries to parse the partition table and list its contents. It
can also tell the kernel to add or remove partitions from its
bookkeeping.
<P>
The
<I>disk</I>
argument is optional when a
<I>partition</I>
argument is provided. To force scanning a partition as if it were a whole disk
(for example to list nested subpartitions), use the argument &quot;-&quot; (hyphen-minus).
For example:
<P>
<DL COMPACT><DT id="1"><DD>
<DL COMPACT>
<DT id="2">partx --show - /dev/sda3<DD>
</DL>
</DL>
<P>
This will see sda3 as a whole-disk rather than as a partition.
<P>
<B>partx is not an fdisk program</B>
- adding and removing partitions does not change the disk, it just
tells the kernel about the presence and numbering of on-disk
partitions.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="3"><B>-a</B>,<B> --add</B>
<DD>
Add the specified partitions, or read the disk and add all partitions.
<DT id="4"><B>-b</B>,<B> --bytes</B>
<DD>
Print the SIZE column in bytes rather than in human-readable format.
<DT id="5"><B>-d</B>,<B> --delete</B>
<DD>
Delete the specified partitions or all partitions.
<DT id="6"><B>-g</B>,<B> --noheadings</B>
<DD>
Do not print a header line with <B>--show</B> or <B>--raw</B>.
<DT id="7"><B>-l</B>,<B> --list</B>
<DD>
List the partitions. Note that all numbers are in 512-byte sectors.
This output format is DEPRECATED in favour of
<B>--show</B>.
Do not use it in newly written scripts.
<DT id="8"><B>-n</B>,<B> --nr </B><I>M</I><B>:</B><I>N</I>
<DD>
Specify the range of partitions. For backward compatibility also the
format <I>M</I><B>-</B><I>N</I> is supported.
The range may contain negative numbers, for example
<B>--nr -1:-1</B>
means the last partition, and
<B>--nr -2:-1</B>
means the last two partitions. Supported range specifications are:
<DL COMPACT><DT id="9"><DD>
<DL COMPACT>
<DT id="10"><I>M</I>
<DD>
Specifies just one partition (e.g. <B>--nr 3</B>).
<DT id="11"><I>M</I><B>:</B>
<DD>
Specifies the lower limit only (e.g. <B>--nr 2:</B>).
<DT id="12"><B>:</B><I>N</I>
<DD>
Specifies the upper limit only (e.g. <B>--nr :4</B>).
<DT id="13"><I>M</I><B>:</B><I>N</I>
<DD>
Specifies the lower and upper limits (e.g. <B>--nr 2:4</B>).
</DL>
</DL>
<DT id="14"><B>-o</B>,<B> --output </B><I>list</I>
<DD>
Define the output columns to use for
<B>--show</B>,
<B>--pairs</B>
and
<B>--raw</B>
output. If no output arrangement is specified, then a default set is
used. Use
<B>--help</B>
to get
<I>list</I>
of all supported columns. This option cannot be combined with the
<B>--add</B>,
<B>--delete</B>,
<B>--update</B>
or
<B>--list</B>
options.
<DT id="15"><B>--output-all</B>
<DD>
Output all available columns.
<DT id="16"><B>-P</B>,<B> --pairs</B>
<DD>
List the partitions using the KEY=&quot;value&quot; format.
<DT id="17"><B>-r</B>,<B> --raw</B>
<DD>
List the partitions using the raw output format.
<DT id="18"><B>-s</B>,<B> --show</B>
<DD>
List the partitions.
The output columns can be selected and rearranged with the
<B>--output</B> option.
All numbers (except SIZE) are in 512-byte sectors.
<DT id="19"><B>-t</B>,<B> --type </B><I>type</I>
<DD>
Specify the partition table type.
<DT id="20"><B>--list-types</B>
<DD>
List supported partition types and exit.
<DT id="21"><B>-u</B>,<B> --update</B>
<DD>
Update the specified partitions.
<DT id="22"><B>-S</B>,<B> --sector-size </B><I>size</I>
<DD>
Overwrite default sector size.
<DT id="23"><B>-v</B>,<B> --verbose</B>
<DD>
Verbose mode.
<DT id="24"><B>-V</B>,<B> --version</B>
<DD>
Display version information and exit.
<DT id="25"><B>-h</B>,<B> --help</B>
<DD>
Display help text and exit.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
<DL COMPACT>
<DT id="26">partx --show /dev/sdb3<DD>
partx --show --nr 3 /dev/sdb
partx --show /dev/sdb3 /dev/sdb
All three commands list partition 3 of /dev/sdb.
<DT id="27">partx --show - /dev/sdb3<DD>
Lists all subpartitions on /dev/sdb3 (the device is used as
whole-disk).
<DT id="28">partx -o START -g --nr 5 /dev/sdb<DD>
Prints the start sector of partition 5 on /dev/sdb without header.
<DT id="29">partx -o SECTORS,SIZE /dev/sda5 /dev/sda<DD>
Lists the length in sectors and human-readable size of partition 5 on
/dev/sda.
<DT id="30">partx --add --nr 3:5 /dev/sdd<DD>
Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
<DT id="31">partx -d --nr :-1 /dev/sdd<DD>
Removes the last partition on /dev/sdd.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+addpart">addpart</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+delpart">delpart</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+fdisk">fdisk</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+parted">parted</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+partprobe">partprobe</A></B>(8)
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHORS</H2>
Davidlohr Bueso
<BR>
Karel Zak
<P>
The original version was written by
Andries E. Brouwer
<A NAME="lbAI">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="32">LIBBLKID_DEBUG=all<DD>
enables libblkid debug output.
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>AVAILABILITY</H2>
The partx command is part of the util-linux package and is available from
Linux Kernel Archive
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="33"><A HREF="#lbAB">NAME</A><DD>
<DT id="34"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="35"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="36"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="37"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="38"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="39"><A HREF="#lbAH">AUTHORS</A><DD>
<DT id="40"><A HREF="#lbAI">ENVIRONMENT</A><DD>
<DT id="41"><A HREF="#lbAJ">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:15 GMT, March 31, 2021
</BODY>
</HTML>