[parted-devel] Support setting more flags (those from the Discoverable Partitions Specification)

Brian C. Lane bcl at redhat.com
Fri Jul 26 00:47:33 BST 2024


On Thu, Jul 25, 2024 at 02:34:55AM +0200, Nils Kattenbeck wrote:
> Hi,
> 
> Due to several reasons the Discoverable Partitions Specification (DSP)
> is getting more popular.
> The DSP also defines several partition flags
> (https://uapi-group.org/specifications/specs/discoverable_partitions_specification/#partition-attribute-flags)
> that can be set and influence the handling of partitions. To my
> knowledge there is currently no tool apart from systemd-repart which
> can write these and none that can really inspect these. It would be
> great if parted will add support for them such that one can easily
> check which flags are set and toggle those flags.

We do support some of them, and we added the ability to set the UUID in
order to support the explosion of new ones :) I really don't want to add
a flag for every single possible one, there are just too many of them. I
think the current situation covers the most common use cases and makes
it possible to use whatever UUID you need.

You can add them using the 'type' command, it will show the current UUID
and let you change it, and you can inspect them if you use the --json
output format.

eg.

(parted) type 1
Partition type-uuid?  [0fc63daf-8483-4772-8e79-3d69d8477de4]? 993d8d3d-f80e-4225-855a-9daf8ed7ea97

parted disk.img -s --json u s p
{
   "disk": {
      "path": "/home/bcl/tmp/disk.img",
      "size": "4194304s",
      "model": "",
      "transport": "file",
      "logical-sector-size": 512,
      "physical-sector-size": 512,
      "label": "gpt",
      "uuid": "99684943-e643-4204-8840-1cf830feb2b0",
      "max-partitions": 128,
      "partitions": [
         {
            "number": 1,
            "start": "2048s",
            "end": "4192255s",
            "size": "4190208s",
            "type": "primary",
            "type-uuid": "993d8d3d-f80e-4225-855a-9daf8ed7ea97",
            "uuid": "105cc168-f8c5-4499-9f8d-944599579425",
            "name": "root"
         }
      ]
   }
}


Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list