[parted-devel] how to create compatible msdos partition tables?

Arvin Schnell aschnell at suse.com
Tue Apr 26 09:59:00 BST 2022


On Mon, Apr 25, 2022 at 09:14:41AM -0700, Brian C. Lane wrote:
> On Sat, Apr 23, 2022 at 08:55:41AM +0200, Harald Dunkel wrote:
> 
> > Would it be possible to extend parted to allow listing and explicitly
> > changing the ID after creating the partition? Hopefully I am not too blind
> > to see, but I did not find such an option mentioned in the documentation.

> This is an area where parted could use some improvement, it has similar
> issues with GPT disks. At one time I looked into adding the ability to
> support arbitrary GUIDs but found it would be pretty difficult to add to
> libparted, requiring extensive changes.

Last year I made a patch adding a "type-id" and "type-uuid"
command, see:

https://alioth-lists.debian.net/pipermail/parted-devel/2021-October/005696.html

After removing all the flags (raid, lvm, swap, ...) from
GPTPartitionData last year it was not so difficult
anymore. Unless there are more problems I do not see.

Unfortunately for DOS the flags are still used in
DosPartitionData and that leads to a problem: E.g. for a
partition with the raid flag, using "type-id <num> 0x83" does not
clear the raid flag.

Maybe the best solution here would be to remove the flags also
from DosPartitionData. That could likely also solve existing
bugs:

- Create a primary partition with ext2 (proposed default). It
  will have the lba flag. Setting raid does not remove the lba
  flag, it shows "raid, lba". Only after restarting parted the
  lba flag is gone.

- It is possible to set the hidden flag on e.g. raid.

If desired I could look into that.

ciao
  Arvin

PS: Meanwhile I noticed that the patch for type-uuid has an
    endianness bug.

-- 
Arvin Schnell, <aschnell at suse.com>
Senior Software Engineer, Research & Development

SUSE Software Solutions Germany GmbH
Maxfeldstraße 5
90409 Nürnberg
Germany

(HRB 36809, AG Nürnberg)

Geschäftsführer: Ivo Totev



More information about the parted-devel mailing list