[parted-devel] [PATCH 1/2] libparted: enforce dos partition limit

Jim Meyering jim at meyering.net
Mon Jan 23 19:19:24 UTC 2012


Phillip Susi wrote:
> On 1/23/2012 1:39 PM, H. Peter Anvin wrote:
>> GPT enforces its limit because *that's how many slots there are in the
>> partition table* (by the way, you *do* handle GPT partition tables with
>> more than 128 slots, right?)
>
> Yes, parted handles more ( or less ) than 128 slots, but only will
> create a table with 128 slots.
>
> The reason I mentioned the gpt limit is because it actually enforces the
> limit.  Code like that in linux.c assumes that the limit that the
> partition table reports is correct, so dos should behave properly and
> enforce whatever limit it claims.

The point is that the GPT format dictates we specify a PTE array size
in the header, while with a dos partition table, there is no inherent
limitation: it's an arbitrarily-long linked list of partition entries.

Any PTE-count limitation we impose when writing a dos partition table
is artificial or system-specific, and hence undesirable.
What if we want to create a partition table that will never
be used on a linux-based system?  Why should it suffer the
limitations of the host kernel?



More information about the parted-devel mailing list