grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: partition numbering


From: Marco Gerards
Subject: Re: partition numbering
Date: Sun, 17 Apr 2005 19:44:33 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

> On Apr 14, 2005, at 12:05 PM, Marco Gerards wrote:
>
>>>>> +      unsigned int partno = grub_strtoul (partition, 0, 0);
>>>>> +      partno--; /* GRUB partition numbering is 0-based.  */
>>>>
>>>> Right.  But how can you be sure both match?
>>>
>>> Eh? OF partition numbers are 1-based. To convert to GRUB's 0-based
>>> numbering, we subtract one. How could that not "match"?
>>
>> Because not in all cases GRUB and the firmware will count partitions
>> the same way.  A good example is the PC partition map.  In linux
>> primary partitions are numbers from 1 to 4, extended partitions are
>> numbered from 5 (IIRC).  One other way to count these partitions is
>> just by starting counting from 1.
>>
>> This is just an example.  There are a lot of partition table layouts
>> and many ways to interpret partition numbers.  I can imagine GRUB
>> does not always work the same as a specific firmware implementation
>> all the time.
>
> If GRUB counts partition numbers different than Open Firmware, I
> consider this a bug that must be fixed. 0-based partition numbers are
> quite confusing enough.

And I do not consider that a bug.  We can not confirm to the way every
OS/firmware implementation numbers its partitions.  This is *not*
about 0-basic partition numbers, but about how the same things can be
handled differently.  We can adapt to the most popular
implementations.  But I am sure things will fail someday.

> In this case, due to the implicit numbering of Apple partition map
> entries, this shouldn't even be an issue.

Right.  But this is not always true.

--
Marco







reply via email to

[Prev in Thread] Current Thread [Next in Thread]