[parted-devel] Interface to set partition type

Jim Meyering jim at meyering.net
Mon Nov 9 10:17:58 UTC 2009


Robert Millan wrote:
> On Sun, Nov 08, 2009 at 04:42:47PM +0100, Jim Meyering wrote:
>> Robert Millan wrote:
>> > On Mon, Oct 19, 2009 at 02:56:08PM +0200, Jim Meyering wrote:
>> >> In the longer term, we'll probably deprecate
>> >> it and instead add an interface to set a partition's type independent
>> >> of mkpart's "type" argument.
>> >
>> > I'd like to work on adding that interface.  I propose:
>> >
>> >   # GPT
>> >   $ parted /dev/sda type 1 00000000-0000-0000-0000-000000000000
>> >
>> >   # MSDOS
>> >   $ parted /dev/sda type 1 00
>> >
>> > Is that appropiate?
>>
>> Thanks for volunteering.
>>
>> Good timing.
...

It seems like it'd be useful to be able to extract existing types,
too, so how about making the string argument optional.
Then, this would print the type of the first partition:

    $ parted /dev/sda part-type 1



More information about the parted-devel mailing list