[parted-devel] ped_assert after a gpt disk is shrunk

rahul dev rahul_dev_agg at yahoo.co.in
Wed Jan 26 09:43:01 UTC 2011


Thanks Jim for answering this.
Its good to know that it is a known problem and has been solved.

However, looking at the solution it looks that we consider such a disk as a non match and don't print any partition information. Also, we don't try to write the secondary table at the end. Is that right ?

Why is it so? Why don't we try to read the partition table based on primary gpt table. Also, we should set write_back to 1 and try to write the secondary header at the end of disk (in case we have a free space at the end).

thanks,
rahul

--- On Wed, 26/1/11, Jim Meyering <jim at meyering.net> wrote:

> From: Jim Meyering <jim at meyering.net>
> Subject: Re: [parted-devel] ped_assert after a gpt disk is shrunk
> To: "rahul dev" <rahul_dev_agg at yahoo.co.in>
> Cc: parted-devel at lists.alioth.debian.org
> Date: Wednesday, 26 January, 2011, 2:02 PM
> rahul dev wrote:
> >   I am using libparted version of
> 1.8.1.
> 
> The latest is parted-2.3.
> Thanks for the report, but...
> 
> > I created a gpt partition table on a disk (which is
> made out of a RAID-0 array). After that I shrink the disk
> size and again try to read the partition table.
> >
> > I hit the following asserts in function gpt_read().
> >
> >   PED_ASSERT ((PedSector)
> PED_LE64_TO_CPU (gpt->AlternateLBA)
> >             
>    <= disk->dev->length - 1, goto
> error_free_gpt);
> >
> > This is due to the reason that after disk is shrunk in
> size, the secondary has gone and primary table still points
> to the old location which is beyond the current disk size.
> >
> > I believe that these asserts should be removed and we
> should try to read the table from the information available
> from the primary table and also try to create secondary gpt
> table at the end of disk if we have sufficient free space
> available at the end of disk which doesn't overlpa with the
> last partition boundary.
> 
> That bug was fixed nearly two years ago:
> 
> http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=554087b39ee0f
> 





More information about the parted-devel mailing list