[parted-devel] [PATCH] Properly sync partitions with operating system

Matt Domsch Matt_Domsch at dell.com
Thu Feb 19 14:11:46 UTC 2009


On Thu, Feb 19, 2009 at 03:05:41PM +0100, Joel Granados wrote:
> On Thu, Feb 19, 2009 at 07:08:16AM -0600, Matt Domsch wrote:
> > On Thu, Feb 19, 2009 at 12:28:14PM +0100, Petr Uzel wrote:
> > > On Wed, Feb 18, 2009 at 10:01:11PM +0100, Joel Granados Moreno wrote:
> > > > diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
> > > > index eea562d..6c9929b 100644
> > > > --- a/libparted/labels/gpt.c
> > > > +++ b/libparted/labels/gpt.c
> > > > @@ -1470,6 +1470,12 @@ gpt_get_max_primary_partition_count (const PedDisk *disk)
> > > >  	return gpt_disk_data->entry_count;
> > > >  }
> > > >  
> > > > +static int
> > > > +gpt_get_max_partitoin_count(const PedDisk *disk)
> > > > +{
> > > > +	return 16;
> > > > +}
> > > > +
> > > 
> > > Are you sure about this? I think GPT has no such on the number of
> > > partitions.
> > 
> > In fact GPT by default (and in parted implementation) has 128
> > partition entry slots.  In theory this can be adjusted upwards at
> > mklabel time (simply reserve additional blocks into which the entries
> > will go).
> 
> For the gpt case I think it is best to make
> gpt_get_max_primary_partitions_count and gpt_get_max_partition_count
> return whatever gpt_get_max_primary_partitoin_count.

Correct. It uses the discovered actual number of partition slots from
the GPT header.

 
> There are no other type of partitions in gpt.  right?

Correct.

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux



More information about the parted-devel mailing list