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--nrranges 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--showor--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 formatM-Nis also supported. the range may contain negative numbers โ for example--nr -1:-1means the last partition, and--nr -2:-1means 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,--pairsand--rawoutput. if no output arrangement is specified, then a default set is used. use--helpto get a list of all supported columns. this option cannot be combined with the--add,--delete,--updateor--listoptions. ๐ซถ--output-allโ output all available columns. all of them. every single one. ๐-P,--pairsโ list the partitions using theKEY="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--outputoption. all numbers (exceptSIZE) 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/sdbwithout 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