{
    "content": [
        {
            "type": "text",
            "text": "# partx(8) (man)\n\n**Summary:** partx - tell the kernel about the presence and numbering of on-disk partitions\n\n**Synopsis:** partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:N] [-] disk\npartx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --add | — | Add the specified partitions, or read the disk and add all partitions. |\n| -b | --bytes | — | Print the SIZE column in bytes rather than in human-readable format. |\n| -d | --delete | — | Delete the specified partitions or all partitions. It is not error to remove non-existing partitions, so this option is  |\n| -g | --noheadings | — | Do not print a header line with --show or --raw. |\n| -l | --list | — | List the partitions. Note that all numbers are in 512-byte sectors. This output format is DEPRECATED in favour of --show |\n| -n | --nr | — | Specify the range of partitions. For backward compatibility also the format M-N is supported. The range may contain nega |\n| -o | --output | — | Define the output columns to use for --show, --pairs and --raw output. If no output arrangement is specified, then a def |\n| — | --output-all | — | Output all available columns. |\n| -P | --pairs | — | List the partitions using the KEY=\"value\" format. |\n| -r | --raw | — | List the partitions using the raw output format. |\n| -s | --show | — | List the partitions. The output columns can be selected and rearranged with the --output option. All numbers (except SIZ |\n| -t | --type | — | Specify the partition table type. |\n| — | --list-types | — | List supported partition types and exit. |\n| -u | --update | — | Update the specified partitions. |\n| -S | --sector-size | — | Overwrite default sector size. |\n| -v | --verbose | — | Verbose mode. |\n| -V | --version | — | Display version information and exit. |\n| -h | --help | — | Display help text and exit. |\n\n## Examples\n\n- `partx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show /dev/sdb3 /dev/sdb`\n- `All three commands list partition 3 of /dev/sdb.`\n- `partx --show - /dev/sdb3`\n- `Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk).`\n- `partx -o START -g --nr 5 /dev/sdb`\n- `Prints the start sector of partition 5 on /dev/sdb without header.`\n- `partx -o SECTORS,SIZE /dev/sda5 /dev/sda`\n- `Lists the length in sectors and human-readable size of partition 5 on /dev/sda.`\n- `partx --add --nr 3:5 /dev/sdd`\n- `Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.`\n- `partx -d --nr :-1 /dev/sdd`\n- `Removes the last partition on /dev/sdd.`\n\n## See Also\n\n- addpart(8)\n- delpart(8)\n- fdisk(8)\n- parted(8)\n- partprobe(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (14 lines)\n- **OPTIONS** (1 lines) — 18 subsections\n  - -a --add (2 lines)\n  - -b --bytes (2 lines)\n  - -d --delete (4 lines)\n  - -g --noheadings (2 lines)\n  - -l --list (3 lines)\n  - -n --nr (17 lines)\n  - -o --output (5 lines)\n  - --output-all (2 lines)\n  - -P --pairs (2 lines)\n  - -r --raw (2 lines)\n  - -s --show (3 lines)\n  - -t --type (2 lines)\n  - --list-types (2 lines)\n  - -u --update (2 lines)\n  - -S --sector-size (2 lines)\n  - -v --verbose (2 lines)\n  - -V --version (2 lines)\n  - -h --help (2 lines)\n- **ENVIRONMENT** (3 lines)\n- **EXAMPLE** (18 lines)\n- **AUTHORS** (4 lines)\n- **SEE ALSO** (2 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\npartx - tell the kernel about the presence and numbering of on-disk partitions\n\n### SYNOPSIS\n\npartx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:N] [-] disk\n\npartx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]\n\n### DESCRIPTION\n\nGiven a device or disk-image, partx tries to parse the partition table and list its contents.\nIt can also tell the kernel to add or remove partitions from its bookkeeping.\n\nThe disk argument is optional when a partition argument is provided. To force scanning a\npartition as if it were a whole disk (for example to list nested subpartitions), use the\nargument \"-\" (hyphen-minus). For example:\n\npartx --show - /dev/sda3\n\nThis will see sda3 as a whole-disk rather than as a partition.\n\npartx is not an fdisk program - adding and removing partitions does not change the disk, it\njust tells the kernel about the presence and numbering of on-disk partitions.\n\n### OPTIONS\n\n#### -a --add\n\nAdd the specified partitions, or read the disk and add all partitions.\n\n#### -b --bytes\n\nPrint the SIZE column in bytes rather than in human-readable format.\n\n#### -d --delete\n\nDelete the specified partitions or all partitions. It is not error to remove non-existing\npartitions, so this option is possible to use together with large --nr ranges without\ncare about the current partitions set on the device.\n\n#### -g --noheadings\n\nDo not print a header line with --show or --raw.\n\n#### -l --list\n\nList the partitions. Note that all numbers are in 512-byte sectors. This output format is\nDEPRECATED in favour of --show. Do not use it in newly written scripts.\n\n#### -n --nr\n\nSpecify the range of partitions. For backward compatibility also the format M-N is\nsupported. The range may contain negative numbers, for example --nr -1:-1 means the last\npartition, and --nr -2:-1 means the last two partitions. Supported range specifications\nare:\n\nM\nSpecifies just one partition (e.g. --nr 3).\n\nM:\nSpecifies the lower limit only (e.g. --nr 2:).\n\n:N\nSpecifies the upper limit only (e.g. --nr :4).\n\nM:N\nSpecifies the lower and upper limits (e.g. --nr 2:4).\n\n#### -o --output\n\nDefine the output columns to use for --show, --pairs and --raw output. If no output\narrangement is specified, then a default set is used. Use --help to get list of all\nsupported columns. This option cannot be combined with the --add, --delete, --update or\n--list options.\n\n#### --output-all\n\nOutput all available columns.\n\n#### -P --pairs\n\nList the partitions using the KEY=\"value\" format.\n\n#### -r --raw\n\nList the partitions using the raw output format.\n\n#### -s --show\n\nList the partitions. The output columns can be selected and rearranged with the --output\noption. All numbers (except SIZE) are in 512-byte sectors.\n\n#### -t --type\n\nSpecify the partition table type.\n\n#### --list-types\n\nList supported partition types and exit.\n\n#### -u --update\n\nUpdate the specified partitions.\n\n#### -S --sector-size\n\nOverwrite default sector size.\n\n#### -v --verbose\n\nVerbose mode.\n\n#### -V --version\n\nDisplay version information and exit.\n\n#### -h --help\n\nDisplay help text and exit.\n\n### ENVIRONMENT\n\nLIBBLKIDDEBUG=all\nenables libblkid debug output.\n\n### EXAMPLE\n\npartx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show /dev/sdb3 /dev/sdb\nAll three commands list partition 3 of /dev/sdb.\n\npartx --show - /dev/sdb3\nLists all subpartitions on /dev/sdb3 (the device is used as whole-disk).\n\npartx -o START -g --nr 5 /dev/sdb\nPrints the start sector of partition 5 on /dev/sdb without header.\n\npartx -o SECTORS,SIZE /dev/sda5 /dev/sda\nLists the length in sectors and human-readable size of partition 5 on /dev/sda.\n\npartx --add --nr 3:5 /dev/sdd\nAdds all available partitions from 3 to 5 (inclusive) on /dev/sdd.\n\npartx -d --nr :-1 /dev/sdd\nRemoves the last partition on /dev/sdd.\n\n### AUTHORS\n\nDavidlohr Bueso <dave@gnu.org>, Karel Zak <kzak@redhat.com>\n\nThe original version was written by Andries E. Brouwer <aeb@cwi.nl>\n\n### SEE ALSO\n\naddpart(8), delpart(8), fdisk(8), parted(8), partprobe(8)\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe partx command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                     PARTX(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "partx",
        "section": "8",
        "mode": "man",
        "summary": "partx - tell the kernel about the presence and numbering of on-disk partitions",
        "synopsis": "partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:N] [-] disk\npartx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk]",
        "flags": [
            {
                "flag": "-a",
                "long": "--add",
                "arg": null,
                "description": "Add the specified partitions, or read the disk and add all partitions."
            },
            {
                "flag": "-b",
                "long": "--bytes",
                "arg": null,
                "description": "Print the SIZE column in bytes rather than in human-readable format."
            },
            {
                "flag": "-d",
                "long": "--delete",
                "arg": null,
                "description": "Delete the specified partitions or all partitions. It is not error to remove non-existing partitions, so this option is possible to use together with large --nr ranges without care about the current partitions set on the device."
            },
            {
                "flag": "-g",
                "long": "--noheadings",
                "arg": null,
                "description": "Do not print a header line with --show or --raw."
            },
            {
                "flag": "-l",
                "long": "--list",
                "arg": null,
                "description": "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."
            },
            {
                "flag": "-n",
                "long": "--nr",
                "arg": null,
                "description": "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:-1 means the last partition, and --nr -2:-1 means the last two partitions. 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)."
            },
            {
                "flag": "-o",
                "long": "--output",
                "arg": null,
                "description": "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 list of all supported columns. This option cannot be combined with the --add, --delete, --update or --list options."
            },
            {
                "flag": "",
                "long": "--output-all",
                "arg": null,
                "description": "Output all available columns."
            },
            {
                "flag": "-P",
                "long": "--pairs",
                "arg": null,
                "description": "List the partitions using the KEY=\"value\" format."
            },
            {
                "flag": "-r",
                "long": "--raw",
                "arg": null,
                "description": "List the partitions using the raw output format."
            },
            {
                "flag": "-s",
                "long": "--show",
                "arg": null,
                "description": "List the partitions. The output columns can be selected and rearranged with the --output option. All numbers (except SIZE) are in 512-byte sectors."
            },
            {
                "flag": "-t",
                "long": "--type",
                "arg": null,
                "description": "Specify the partition table type."
            },
            {
                "flag": "",
                "long": "--list-types",
                "arg": null,
                "description": "List supported partition types and exit."
            },
            {
                "flag": "-u",
                "long": "--update",
                "arg": null,
                "description": "Update the specified partitions."
            },
            {
                "flag": "-S",
                "long": "--sector-size",
                "arg": null,
                "description": "Overwrite default sector size."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Verbose mode."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            }
        ],
        "examples": [
            "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.",
            "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."
        ],
        "see_also": [
            {
                "name": "addpart",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/addpart/8/json"
            },
            {
                "name": "delpart",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/delpart/8/json"
            },
            {
                "name": "fdisk",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/fdisk/8/json"
            },
            {
                "name": "parted",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/parted/8/json"
            },
            {
                "name": "partprobe",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/partprobe/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --add",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--add"
                    },
                    {
                        "name": "-b --bytes",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--bytes"
                    },
                    {
                        "name": "-d --delete",
                        "lines": 4,
                        "flag": "-d",
                        "long": "--delete"
                    },
                    {
                        "name": "-g --noheadings",
                        "lines": 2,
                        "flag": "-g",
                        "long": "--noheadings"
                    },
                    {
                        "name": "-l --list",
                        "lines": 3,
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-n --nr",
                        "lines": 17,
                        "flag": "-n",
                        "long": "--nr"
                    },
                    {
                        "name": "-o --output",
                        "lines": 5,
                        "flag": "-o",
                        "long": "--output"
                    },
                    {
                        "name": "--output-all",
                        "lines": 2,
                        "long": "--output-all"
                    },
                    {
                        "name": "-P --pairs",
                        "lines": 2,
                        "flag": "-P",
                        "long": "--pairs"
                    },
                    {
                        "name": "-r --raw",
                        "lines": 2,
                        "flag": "-r",
                        "long": "--raw"
                    },
                    {
                        "name": "-s --show",
                        "lines": 3,
                        "flag": "-s",
                        "long": "--show"
                    },
                    {
                        "name": "-t --type",
                        "lines": 2,
                        "flag": "-t",
                        "long": "--type"
                    },
                    {
                        "name": "--list-types",
                        "lines": 2,
                        "long": "--list-types"
                    },
                    {
                        "name": "-u --update",
                        "lines": 2,
                        "flag": "-u",
                        "long": "--update"
                    },
                    {
                        "name": "-S --sector-size",
                        "lines": 2,
                        "flag": "-S",
                        "long": "--sector-size"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}