On Mon, Jul 4, 2011 at 11:32 PM, Kenneth R Westerback
<kwesterb...@rogers.com> wrote:
> On Mon, Jul 04, 2011 at 09:38:37PM -0430, Andres Perera wrote:
>> On Mon, Jul 4, 2011 at 8:56 PM, Kenneth R Westerback
>> <kwesterb...@rogers.com> wrote:
>> > The use of CHS should be hard and attempted only by
>> > those who know all the rules already.
>>
>> which is made difficult by not being able to select a subset of cyls,
>> since fdisk caps them at 1024 on amd64
>>
>> note that geom was, and continues to be, only relevant for the
>> duration of that fdisk instance
>>
>> all the changes are just to help with partitioning, e.g. by using a
>> percentage based on the subset of cyls that i could select, or just
>> globbing the entire cyl range
>>
>> at the moment it is not for people that know the intricacies, as
>> you're implying. it doesn't allow for anything useful
>>
>> if geom is removed from fdisk, then the obsd install ideally has to
>> account for geom changes before making mbr partitions
>
> MBR partitions are created based solely on lba info, with the chs
> info just faked in. Removing geom would have no impact on the install
> as far as I know. At least for 99.9% of situations. That would be
> an interesting experiment.
>
> .... Ken

even though it's ultimately the same for people that don't change
them, mbr partitions are not created from lba in fdisk.

the data goes through this mangling:

1. lba (disklabel, which means that it's not necessarily lba)
2. boundless CHS
3. boundless CHS is influenced by geom ("disk" command)
4. 255/63 check (cylinders are ignored for the check and always written as 1024)
5. partitions are created based on boundless CHS, partition end is
usually aligned with last cylinder
6. dishonest bounded CHS gets written to mbr

from this point, it either writes 255 in all CHS fields except the 2
bit S field, or an almost honest representation of lba

since you can change the "boundless CHS" through geom, then CHS values
do influence, just not the ones in the MBR... it's important to make
that distinction in order to get anywhere with this mess

besides that,

for people that want to partition mbr after *really* changing CHS
values: during install they have to access the shell and change CHS
with disklabel before fdisk. that's fine since it is an unusual need:

disklabel (fill in boundstart and end, or don't partition yet) ->
fdisk -> disklabel

but two things need to be clarified: the order is assbackwards.
disklabel influences fdisk, and fdisk influences disklabel (to set
boundstart and boundend). this complexity is a problem no matter what
happens to geom with fdisk

the second thing is that the "disk" command is misleading since it
does not expose the relationship between disklabel and fdisk, in fact,
it actively confuses how the two relate. improving the "disk" command,
like i suggested + writing to disklabel, would lead to less circling
dependencies. but the better solution requires more drastic changes
than the ones i proposed: disklabel should not handle geom +
partitions, it's a mess. whatever handles geom comes before fdisk and
disklabel

Reply via email to