{
    "mode": "man",
    "parameter": "PARTED",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/PARTED/8/json",
    "generated": "2026-10-06T11:20:59Z",
    "synopsis": "parted [options] [device [command [options...]...]]",
    "sections": {
        "NAME": {
            "content": "parted - a partition manipulation program\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "parted [options] [device [command [options...]...]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "parted is a program to manipulate disk partitions.  It supports multiple partition table for‐\nmats,  including  MS-DOS and GPT.  It is useful for creating space for new operating systems,\nreorganising disk usage, and copying data to new hard disks.\n\nThis manual page documents parted briefly.  Complete documentation is  distributed  with  the\npackage in GNU Info format.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h, --help",
                    "content": "displays a help message\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-l, --list",
                    "content": "lists partition layout on all block devices\n",
                    "flag": "-l",
                    "long": "--list"
                },
                {
                    "name": "-m, --machine",
                    "content": "displays machine parseable output\n",
                    "flag": "-m",
                    "long": "--machine"
                },
                {
                    "name": "-j, --json",
                    "content": "displays JSON output\n",
                    "flag": "-j",
                    "long": "--json"
                },
                {
                    "name": "-s, --script",
                    "content": "never prompts for user intervention\n",
                    "flag": "-s",
                    "long": "--script"
                },
                {
                    "name": "-f, --fix",
                    "content": "automatically answer \"fix\" to exceptions in script mode\n",
                    "flag": "-f",
                    "long": "--fix"
                },
                {
                    "name": "-v, --version",
                    "content": "displays the version\n",
                    "flag": "-v",
                    "long": "--version"
                },
                {
                    "name": "-a _",
                    "content": "Set alignment for newly created partitions, valid alignment types are:\n\nnone   Use the minimum alignment allowed by the disk type.\n\ncylinder\nAlign partitions to cylinders.\n\nminimal\nUse  minimum  alignment as given by the disk topology information. This and the\nopt value will use layout information provided by the disk to align the logical\npartition table addresses to actual physical blocks  on  the  disks.   The  min\nvalue is the minimum alignment needed to align the partition properly to physi‐\ncal blocks, which avoids performance degradation.\n\noptimal\nUse optimum alignment as given by the disk topology information. This aligns to\na  multiple of the physical block size in a way that guarantees optimal perfor‐\nmance.\n\n",
                    "flag": "-a"
                }
            ]
        },
        "COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "[device]",
                    "content": "The block device to be used.  When none is given, parted will use the first block  de‐\nvice it finds.\n"
                },
                {
                    "name": "[command [options]]",
                    "content": "Specifies  the  command to be executed.  If no command is given, parted will present a\ncommand prompt.  Possible commands are:\n\nhelp [command]\nPrint general help, or help on command if specified.\n\nalign-check type partition\nCheck if partition satisfies the alignment constraint of type.   type  must  be\n\"minimal\" or \"optimal\".\n\nmklabel label-type\nCreate  a  new disklabel (partition table) of label-type.  label-type should be\none of \"aix\", \"amiga\", \"bsd\", \"dvh\", \"gpt\", \"loop\", \"mac\", \"msdos\", \"pc98\",  or\n\"sun\".\n\nmkpart [part-type name fs-type] start end\nCreate a new partition. part-type may be specified only with msdos and dvh par‐\ntition  tables,  it should be one of \"primary\", \"logical\", or \"extended\".  name\nis required for GPT partition tables and fs-type is optional.  fs-type  can  be\none  of  \"btrfs\",  \"ext2\",  \"ext3\",  \"ext4\",  \"fat16\",  \"fat32\", \"hfs\", \"hfs+\",\n\"linux-swap\", \"ntfs\", \"reiserfs\", \"udf\", or \"xfs\".\n\nname partition name\nSet the name of partition to name. This option works only on Mac, PC98, and GPT\ndisklabels. The name can be placed in double quotes, if necessary.  And depend‐\ning on the shell may need to also be wrapped in single quotes so that the shell\ndoesn't strip off the double quotes.\n\nprint print-type\nDisplay the partition table.  print-type is optional, and can  be  one  of  de‐\nvices, free, list, or all.\n\nquit   Exit from parted.\n\nrescue start end\nRescue a lost partition that was located somewhere between start and end.  If a\npartition  is  found,  parted will ask if you want to create an entry for it in\nthe partition table.\n\nresizepart partition end\nChange the end position of partition.  Note  that  this  does  not  modify  any\nfilesystem present in the partition.\n\nrm partition\nDelete partition.\n\nselect device\nChoose  device  as the current device to edit. device should usually be a Linux\nhard disk device, but it can be a partition, software raid device,  or  an  LVM\nlogical volume if necessary.\n\nset partition flag state\nChange  the  state  of  the  flag  on partition to state.  Supported flags are:\n\"boot\", \"root\", \"swap\", \"hidden\", \"raid\", \"lvm\", \"lba\", \"legacyboot\",  \"irst\",\n\"msftres\",  \"esp\", \"chromeoskernel\", \"blsboot\", \"linux-home\", \"noautomount\",\n\"biosgrub\", and \"palo\".  state should be either \"on\" or \"off\".\n\nunit unit\nSet unit as the unit to use when displaying locations and sizes, and for inter‐\npreting those given by the user when not suffixed with an explicit unit.   unit\ncan  be  one  of  \"s\"  (sectors),  \"B\" (bytes), \"kB\", \"MB\", \"KiB\", \"MiB\", \"GB\",\n\"GiB\", \"TB\", \"TiB\", \"%\" (percentage of device size), \"cyl\"  (cylinders),  \"chs\"\n(cylinders,  heads,  sectors),  or \"compact\" (megabytes for input, and a human-\nfriendly form for output).\n\ntoggle partition flag\nToggle the state of flag on partition.\n\ntype partition id or uuid\nOn MS-DOS set the type aka. partition id of partition to id. The id is a  value\nbetween \"0x01\" and \"0xff\". On GPT the type-uuid of partition to uuid.\n\ndiskset flag state\nChange  a  flag on the disk to state. A flag can be either \"on\" or \"off\".  Some\nor all of these flags will be available, depending on what disk label  you  are\nusing.   Supported flags are: \"pmbrboot\" on GPT to enable the boot flag on the\nGPT's protective MBR partition.\n\ndisktoggle flag\nToggle the state of the disk flag.\n\nversion\nDisplay version information and a copyright message.\n"
                }
            ]
        },
        "REPORTING BUGS": {
            "content": "Report bugs to <bug-parted@gnu.org>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fdisk(8), mkfs(8), The parted program is fully documented in the info(1)  format  GNU  parti‐\ntioning software manual which is distributed with the parted-doc Debian package.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "This  manual page was written by Timshel Knoll <timshel@debian.org>, for the Debian GNU/Linux\nsystem (but may be used by others).\n\nparted                                    2021 September 28                                PARTED(8)",
            "subsections": []
        }
    },
    "summary": "parted - a partition manipulation program",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "displays a help message"
        },
        {
            "flag": "-l",
            "long": "--list",
            "arg": null,
            "description": "lists partition layout on all block devices"
        },
        {
            "flag": "-m",
            "long": "--machine",
            "arg": null,
            "description": "displays machine parseable output"
        },
        {
            "flag": "-j",
            "long": "--json",
            "arg": null,
            "description": "displays JSON output"
        },
        {
            "flag": "-s",
            "long": "--script",
            "arg": null,
            "description": "never prompts for user intervention"
        },
        {
            "flag": "-f",
            "long": "--fix",
            "arg": null,
            "description": "automatically answer \"fix\" to exceptions in script mode"
        },
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "displays the version"
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "Set alignment for newly created partitions, valid alignment types are: none Use the minimum alignment allowed by the disk type. cylinder Align partitions to cylinders. minimal Use minimum alignment as given by the disk topology information. This and the opt value will use layout information provided by the disk to align the logical partition table addresses to actual physical blocks on the disks. The min value is the minimum alignment needed to align the partition properly to physi‐ cal blocks, which avoids performance degradation. optimal Use optimum alignment as given by the disk topology information. This aligns to a multiple of the physical block size in a way that guarantees optimal perfor‐ mance."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "fdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/fdisk/8/json"
        },
        {
            "name": "mkfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs/8/json"
        },
        {
            "name": "info",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/info/1/json"
        }
    ]
}