[parted-devel] libparted and partition system id

Petr Uzel petr.uzel at suse.cz
Thu Jun 30 07:25:45 UTC 2011


On Mon, Jun 27, 2011 at 11:07:52PM +0200, Jim Meyering wrote:
> Petr Uzel wrote:
> 
> > On Sat, Jun 25, 2011 at 11:08:44PM -0700, ben wrote:
> >> Using libparted is there a way to set the system ID of the partition, for
> >> instance 0x83 for linux,  without using libparted to actualy write a filesystem
> >> to the partition?
> >
> > As far as I know, this is not possible with vanilla parted. However,
> > you finally forced me to post here our SUSE patch that 'abuses'
> > partition flags in (lib)parted for setting partition types. Attaching
> > version that applies to parted-2.4.
> >
> >
> > Jim, if I clean (at least the testsuite has to be adapted) the patch,
> > would you be willing to accept it?
> 
> Hi Petr,
> 
> This looks useful.
> 
> However, shouldn't any type-setting scheme try to be useful with GPT
> partitions in addition to MSDOS ones?  I'd be happy to be able to set
> the types of only those two partition table types, for now.  Of course,
> just *how* to specify a GPT partition type is not as clear cut as it is
> for MSDOS.  Do you want to always require a full UUID?  Short-cuts for
> common values?  Once you provide interfaces to set these things, it's only
> logical to expect an interface to get/print the values.  When thinking
> about setting and especially printing arbitrary GPT partition type UUIDs,
> I begin to think it'd be best not to try to shoe-horn this functionality
> into the "flags".

Hi Jim, Karel and all,

You are right - it should be possible to at least set partition type
for GPT and msdos (and maybe others - Karel mentioned mac).

For GPT, I also agree that it should be possible to specify both full
UUID as well as shortcuts for some of the most commonly used values.

As for printing the type - do you think that extending 'parted print'
with type information is sufficient or would you prefer some other
way (command) of printing it? IMHO 'parted print' is fine.

And yes, using flags does not seem like a best idea, even if it worked
:) For setting the partition type, I can imagine new command, 'parted
type' which would call partition-table-type specific function to query
the user and then set the type.

I'd like to work on this (as well as on FS-agnostic move and resize
commands we discussed recently). Right now I'm busy with SLES stuff
and will have vacation soon (no computers!! :) ), but I won't forget
this.


Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode



More information about the parted-devel mailing list