[parted-devel] Interface to set partition type

Jim Meyering jim at meyering.net
Tue Nov 10 07:00:27 UTC 2009


Karel Zak wrote:
> On Mon, Nov 09, 2009 at 11:17:58AM +0100, Jim Meyering wrote:
>> 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
>
>  This reminds me ...
>
>  ... it would be also nice to have a way how set partition UUID.
>  Currently GPT UUID is always generated. Maybe we will use the UUID
>  for some userspace operations (DevKits, udev, mount, ...) and then
>  people will look for a way how to control this identifier.
>
>  (Yes, I know that UUID should be unique, but sometimes is it very
>  useful to create a new disk layout with the same UUIDs.)
>
>      $ parted /dev/sda part-uuid 89ec2a20-ab3a-4105-b5e8-b141666fbd0c

Yes, that sounds worthwhile, too.
While thinking about how to use that, I realized that the uuid-setting
command line interface would be slightly more useful if it were to print
the old value when setting a new one.

Robert, please make part-type print the old one, too, in that case.

Thanks!



More information about the parted-devel mailing list