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

Re: enumerating with Grub*



On Fri 08 Jul 2016 at 01:44:28 (-0400), Felix Miata wrote:
> David Wright composed on 2016-07-08 00:04 (UTC-0500):
> 
> >What I'm trying to find out is why you wrote "Grub2 *inexplicably*
> >counts partitions starting with 1" (my emphasis) when everything
> >I've ever seen counts partitions from 1 (with the notable exception
> >of old Grub). I think they've been counted from 1 since their invention.
> 
> The inexplicable part is a consequence of never having seen anything
> explaining *why* the change that breaks backward compatibility with
> itself and the compendium of archived help discussion was made, nor
> why made only for partition enumeration, not disk enumeration, thus
> mixing two counting methods within single configuration strings.
> 
> >However, I've fallen behind in disk technology, still using PATA
> >disks except for caddies. Hence my question about newfangled devices.
> >Do any of those expect you to count their partitions from other than 1?
> >I'm just flailing around for a reason why old Grub might have done what
> >it did, because you haven't yet given one.
> 
> I wasn't trying to explain why it did what it did, only what it did.

Fair enough. You and I see things from a very different perspective.
You want to see the whys of Grub2's scheme, I want those of old Grub.
You see breaking backwards compatibility as inexplicable. I see that
as less important than the major design flaw (IMHO) in old Grub of
counting partitions in a unique (noone has come up with a counter-
example) manner.

The argument of mixing counting methods (disks from 0, partitions
from 1) is a red herring. Counting this way is firmly established. Why
do partitions count from 1? Well, it might be because the designers
realised that '0' could be used as an indication of the whole
disk. There's no such concept when enumerating disks. /sbin/lilo -A
uses 0 in just this way: it deactivates all partitions.

But as for design flaws, I see that choice of partitions counted from
0 in old Grub in much the same way as, say, Guido's choice of integer
division (3 / 2 yields 1) in Python versions before 3: an unfortunate
choice. The backwards compatibility broken by that change alone in
py2→py3 makes enumeration changes in Grub seem trivial to get
frustrated by. The person who started this subthread seemed to have
difficulty with the numbers 0 and 1 anyway.

Cheers,
David.


Reply to: