PARTX(8)

๐Ÿ’– PARTX โ€” the manual, but make it make sense ๐Ÿ’–

okay bestie, this is partx from the System Administration corner of your system, and no cap, it's lowkey one of the most useful little tools for talking to your kernel about partitions. sit down, grab a strawberry ๐Ÿ“, we're doing this.


โœจ NAME โœจ

partx โ€” tell the kernel about the presence and numbering of on-disk partitions

like literally, that's the whole job. it's the messenger between your disk image and your kernel. ๐Ÿซถ


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:N] [-] disk

partx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]

two whole forms, two whole vibes. pick your fighter. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea. give partx a device or a disk image, and it will try to parse the partition table and list what's in there. that's the reading part. ๐Ÿ“–

but it can also slide into the kernel's DMs and tell it to add or remove partitions from its bookkeeping. that's the doing part. ๐Ÿ‘‘

the disk argument is optional when you hand it a partition argument instead. and if you want to force it to scan a partition as if it were a whole disk โ€” say, because you're trying to peek at nested subpartitions โ€” you pass the argument - (that's a hyphen-minus, bestie, not a dash from a fancy font, don't get cute). for example:

partx --show - /dev/sda3

this will see sda3 as a whole-disk rather than as a partition. iconic behaviour honestly. ๐ŸŒธ

important: partx 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. so like, don't expect it to rewrite your partition table, that's simply not what it does. ๐Ÿ™ˆ

โœจ OPTIONS โœจ

  • -a, --add โ€” add the specified partitions, or read the disk and add all partitions.
  • -b, --bytes โ€” print sizes in bytes instead of that human-readable cuteness. by default, sizes are shown in units that are powers of 1024 bytes. and the formal abbreviations for these units (KiB, MiB, GiB, ...) get further shortened to just their first letter: K, M, G, .... so it's giving minimalist. ๐Ÿ’…
  • -d, --delete โ€” delete the specified partitions or all partitions. and here's the thing: it is not an error to remove non-existing partitions. so you can absolutely use this with big --nr ranges and not care at all about what partitions currently live on the device. zero anxiety, just deleting. ๐Ÿ’€
  • -g, --noheadings โ€” do not print a header line with --show or --raw. headerless. sleek. mysterious. ๐ŸŽ€
  • -l, --list โ€” list the partitions. note that all numbers are in 512-byte sectors. this output format is DEPRECATED in favour of --show. do not use it in newly written scripts, i'm begging you. ๐Ÿšซ
  • -n, --nr M:N โ€” specify the range of partitions. for backward compatibility, the format M-N is also supported. the range may contain negative numbers โ€” for example --nr -1:-1 means the last partition, and --nr -2:-1 means the last two partitions. the supported range specifications are:
    • M โ€” specifies just one partition (e.g. --nr 3).
    • M: โ€” specifies the lower limit only (e.g. --nr 2:).
    • :N โ€” specifies the upper limit only (e.g. --nr :4).
    • M:N โ€” specifies the lower and upper limits (e.g. --nr 2:4).
  • -o, --output list โ€” define the output columns to use for --show, --pairs and --raw output. if no output arrangement is specified, then a default set is used. use --help to get a list of all supported columns. this option cannot be combined with the --add, --delete, --update or --list options. ๐Ÿซถ
  • --output-all โ€” output all available columns. all of them. every single one. ๐Ÿ’–
  • -P, --pairs โ€” list the partitions using the KEY="value" format.
  • -r, --raw โ€” list the partitions using the raw output format.
  • -s, --show โ€” list the partitions. the output columns can be selected and rearranged with the --output option. all numbers (except SIZE) are in 512-byte sectors. ๐Ÿ‘‘
  • -t, --type type โ€” specify the partition table type.
  • --list-types โ€” list supported partition types and exit.
  • -u, --update โ€” update the specified partitions.
  • -S, --sector-size size โ€” overwrite default sector size.
  • -v, --verbose โ€” verbose mode. it will talk. a lot. ๐Ÿ—ฃ๏ธ
  • -h, --help โ€” display help text and exit.
  • -V, --version โ€” display version and exit.

๐ŸŒธ ENVIRONMENT ๐ŸŒธ

  • LIBBLKID_DEBUG=all โ€” enables libblkid debug output. if you want the lore, this is how you get it. ๐Ÿ”

๐Ÿงš EXAMPLE ๐Ÿงš

  • partx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show /dev/sdb3 /dev/sdb โ€” all three commands list partition 3 of /dev/sdb. three paths, one destiny. โญ
  • partx --show - /dev/sdb3 โ€” lists all subpartitions on /dev/sdb3 (the device is used as whole-disk).
  • partx -o START -g --nr 5 /dev/sdb โ€” prints the start sector of partition 5 on /dev/sdb without header.
  • partx -o SECTORS,SIZE /dev/sda5 /dev/sda โ€” lists the length in sectors and human-readable size of partition 5 on /dev/sda.
  • partx --add --nr 3:5 /dev/sdd โ€” adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
  • partx -d --nr -1: /dev/sdd โ€” removes the last partition on /dev/sdd. bye bestie ๐Ÿ‘‹

๐Ÿ’œ AUTHORS ๐Ÿ’œ

Davidlohr Bueso <dave@gnu.org>, Karel Zak <kzak@redhat.com>

the original version was written by Andries E. Brouwer <aeb@cwi.nl>

legends, honestly. ๐Ÿซก


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

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

the whole friend group. go say hi. ๐Ÿ’…


๐Ÿ˜ญ REPORTING BUGS ๐Ÿ˜ญ

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.

not me asking you to file an issue instead of just complaining in the group chat. fr fr, they actually read them. ๐Ÿ›

๐ŸŽ€ AVAILABILITY ๐ŸŽ€

the partx command is part of the util-linux package which can be downloaded from the Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


and that's the whole thing, bestie! this page is from util-linux 2.42.4, dated 2026-09-21 โ€” so like, remember that era, because that's when this manual was out here living its truth. โœจ๐Ÿฆ‹ go forth and list some partitions. you got this. ๐Ÿ’–

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms