[parted-devel] [PATCH 0/2] gpt: Preserve relocated primary partition table

Brian C. Lane bcl at redhat.com
Mon Mar 23 18:02:43 GMT 2026


On Wed, Nov 19, 2025 at 06:42:59PM +0000, Pascal Hambourg wrote:
> The primary GPT partition entry array may start at a LBA other than the
> default in order to not interfere with the boot loader for some ARM SoC
> E.g.:
> - The boot loader for Freescale/NXP i.MX < 8 family must start at LBA 2.
> - The boot loader for older Allwinner sunxi family must start at LBA 16.
> 
> This patchset also splits the metadata at the beginning of the disk in
> two:
> - protective MBR + primary GPT header
> - primary GPT partition entry array
> 
> This makes it possible to see the gap between them and check if the
> metadata layout may interfere with the boot loader. However it would be
> better if the gap was not reported as free space. Is there a way to
> avoid this ?
> 
> Pascal Hambourg (2):
>   gpt: Preserve primary partition entry array location
>   gpt: Recalculate PrimaryPartitionEntryLBA when primary partition table
>     is invalid
> 
>  libparted/labels/gpt.c | 27 +++++++++++++++++++++++----
>  1 file changed, 23 insertions(+), 4 deletions(-)
> 
> -- 
> 2.39.5

I've had a look at this again, and I'm uncomfortable including this at
this time. I really would like more feedback from other people, but at
the least I think this needs tests that prove it hasn't interfered with
normal use cases.

I'm also not sure about splitting the metadata entries, I'd like to hear
from people that use these to make sure that having 2 instead of one (in
the normal disk case) doesn't cause issues.

I think there is a bug with the corrupt primary case, it doesn't (at
least as far as I can tell without writing tests) recalculate the
FirstUsableLBA that is setup using LBA 2 as the start of the partition
entries.

Sorry it has taken so long to review this again, I'll try to be more
responsive.

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list