[parted-devel] [PATCH 0/2] gpt: Preserve relocated primary partition table
Pascal Hambourg
pascal at plouf.fr.eu.org
Sat Mar 28 13:40:16 GMT 2026
On 23/03/2026 at 19:02, Brian C. Lane wrote:
> 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 ?
>
> I've had a look at this again, and I'm uncomfortable including this at
> this time.
Of course. It is still work in progress.
> 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.
Which kind of tests would be needed ?
> 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.
GPT already has two metadata areas, at the beginning and the end of the
disk. Do you worry about adding an extra metadata area, or only about
Splitting the primary metadata area when there is a gap between the
primary header and PEA is needed to check if GPT metadata may interfere
with the boot loader area.
As I wrote, however I am uncomfortable with showing the gap as free
space because of possible side effects (same with the current behaviour
of showing the gap between the primary PEA and the first usable LBA as
free space, leading to new partitions being smaller than expected). Any
opinion about the proposal to hide this unusable space I posted on
14/12/2025 ?
> 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.
AFAICS FirstUsableLBA is not recalculated when the primary header is
valid either. IMO it is safer to assume that non-standard but valid
geometry was set up for a reason and preserve it, without automatically
and silently recalculating any part of it.
More information about the parted-devel
mailing list