[parted-devel] Interface to set partition type

Robert Millan rmh at aybabtu.com
Sun Nov 8 16:10:20 UTC 2009


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.
> Just two or three days ago, Rich Jones was asking
> about setting the partition type to arbitrary values,
> though I think he found a reasonable work-around.
> 
> "type" sounds a little too generic.  But it does have an advantage...
> One alternative is "part-type".
> 
> If we go with that (it'd be the second command name starting with "p"),
> we may have to be careful to continue to support "p" as an abbreviation
> for "print".

I thought about part-type, but then it came to mind: Parted is a partition
tool; shouldn't it be implicit that we're setting the type of a partition?

> If you do implement this, please use gnulib's xstrtoul to convert
> an msdos type string so that inputs may be hexadecimal, octal or decimal.
> 
> I see you have a copyright on file for parted.  Good.
> 
> Regarding format, please follow the guidelines in
>   http://git.sv.gnu.org/cgit/coreutils.git/plain/HACKING
> 
> A complete change like this will also update NEWS, documentation and tests.
> Re tests, if you merely outline the commands you'd run to get
> reasonable coverage of the new code, I'll write the actual
> test script.

Alright.  I won't have time to do this today, but expect me to come back
with code sometime around next week.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



More information about the parted-devel mailing list