1PARTX(8)                     System Administration                    PARTX(8)
2
3
4

NAME

6       partx  -  tell the Linux kernel about the presence and numbering of on-
7       disk partitions
8

SYNOPSIS

10       partx [-a|-d|-s|-u] [-t TYPE] [-n M:N] [-] disk
11       partx [-a|-d|-s|-u] [-t TYPE] partition [disk]
12

DESCRIPTION

14       Given a device or disk-image, partx tries to parse the partition  table
15       and list its contents.  It optionally adds or removes partitions.
16
17       The  disk  argument  is optional when a partition argument is provided.
18       To force scanning a partition as if it were a whole disk  (for  example
19       to list nested subpartitions), use the argument "-".  For example:
20
21
22              partx --show - /dev/sda3
23
24       This will see sda3 as a whole-disk rather than a partition.
25
26       The  partx  is  not  an fdisk program -- adding and removing partitions
27       does not change the disk, it just tells the kernel about  the  presence
28       and numbering of on-disk partitions.
29

OPTIONS

31       -a, --add
32              Add  the specified partitions, or read the disk and add all par‐
33              titions.
34
35       -b, --bytes
36              Print the SIZE column in bytes  rather  than  in  human-readable
37              format.
38
39       -d, --delete
40              Delete the specified partitions or all partitions.
41
42       -u, --update
43              Update the specified partitions.
44
45       -g, --noheadings
46              Do not print a header line.
47
48       -h, --help
49              Print a help text and exit.
50
51       -l, --list
52              List the partitions.  Note that all numbers are in 512-byte sec‐
53              tors.  This output format is DEPRECATED in favour of --show.  Do
54              not use it in newly written scripts.
55
56       -o, --output list
57              Define  the  output  columns to use for --show and --raw output.
58              If no output arrangement is specified, then  a  default  set  is
59              used.   Use  --help  to get list of all supported columns.  This
60              option  cannot  be  combined  with  --add,  --delete  or  --list
61              options.
62
63       -P, --pairs
64              Output using key="value" format.
65
66       -n, --nr M:N
67              Specify  the  range  of  partitions.  For backward compatibility
68              also the format M-N is supported.  The range may  contain  nega‐
69              tive numbers, for example --nr :-1 means the last partition, and
70              --nr -2:-1 means the last two partitions.  Supported range spec‐
71              ifications are:
72
73                     M      Specifies just one partition (e.g. --nr 3).
74
75                     M:     Specifies lower limit only (e.g. --nr 2:).
76
77                     :N     Specifies upper limit only (e.g. --nr :4).
78
79                     M:N or
80                     M-N    Specifies lower and upper limits (e.g. --nr 2:4).
81
82       -r, --raw
83              Use the raw output format.
84
85       -s, --show
86              List  the partitions.  All numbers (except SIZE) are in 512-byte
87              sectors.  The output columns can be rearranged with the --output
88              option.
89
90       -t, --type type
91              Specify the partition table type aix, bsd, dos, gpt, mac, minix,
92              sgi, solaris_x86, sun, ultrix or unixware.
93
94       -v, --verbose
95              Verbose mode.
96

EXAMPLES

98       partx --show /dev/sdb3
99       partx --show --nr 3 /dev/sdb
100       partx --show /dev/sdb3 /dev/sdb
101              All three commands list partition 3 of /dev/sdb.
102
103       partx --show - /dev/sdb3
104              Lists all subpartitions on /dev/sdb3  (the  device  is  used  as
105              whole-disk).
106
107       partx -o START -g --nr 5 /dev/sdb
108              Prints  the  start  sector  of  partition  5 on /dev/sdb without
109              header.
110
111       partx -o SECTORS,SIZE /dev/sda5 /dev/sda
112              Lists the length in sectors and human-readable size of partition
113              5 on /dev/sda.
114
115       partx --add --nr 3:5 /dev/sdd
116              Adds  all  available  partitions  from  3  to  5  (inclusive) on
117              /dev/sdd.
118
119       partx -d --nr :-1 /dev/sdd
120              Removes the last partition on /dev/sdd.
121

SEE ALSO

123       addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)
124

AUTHORS

126       Davidlohr Bueso ⟨dave@gnu.org⟩
127       Karel Zak ⟨kzak@redhat.com⟩
128
129       The original version was written by Andries E. Brouwer ⟨aeb@cwi.nl⟩.
130

ENVIRONMENT

132       LIBBLKID_DEBUG=0xffff
133              enables debug output.
134

AVAILABILITY

136       The partx command is part of the util-linux package  and  is  available
137       from  Linux  Kernel Archive ⟨ftp://ftp.kernel.org/pub/linux/utils/util-
138       linux/⟩.
139
140
141
142util-linux                         June 2012                          PARTX(8)
Impressum