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

Jim Meyering jim at meyering.net
Wed Jan 26 08:32:57 UTC 2011


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