On Sun, 2010-03-21 at 03:33 +0100, Cesare Leonardi wrote:
> Package: linux-image-2.6.32-4-686
> Version: 2.6.32-10
> Severity: normal
>
> I will be verbose mainly to help the kernel team, because i suspect
> this problem will arise for others during this libata transition.
> Dear maintainter, this bug has documentation purposes: treat it as you
> like. It isn't really a bug: it's a mixture of buggy BIOS and kernel
> design decisions that, on some non-new hardware, can cause serious
> trouble during this transition.
> And however, as reported below, i've already managed to find a
> workaround.
Thank you very much for taking the time to research and document this.
> The problem: after rebooting with the new libata enabled kernel, my
> system immediately stopped the boot phase showing filesystem problems
> and asking me to do an fsck. The reported cause was an home partition
> that overflow the disk size.
> I haven't run the suggested fsck, but rather some investigation and to
> my surprise i discovered that my 160 GB hard disk is now seen as a
> 137 GB!
> As a consequence this made invisible my swap partition (beyond 137 GB)
> and my home partition is partially seen.
[...]
> Then, rebooting with the previous 2.6.32-3-686 kernel i've found these
> messages:
> [ 4.563873] hda: Host Protected Area detected.
> [ 4.563874] current capacity is 268435455 sectors (137438 MB)
> [ 4.563876] native capacity is 312581808 sectors (160041 MB)
> [ 4.563880] hda: 268435455 sectors (137438 MB) w/8192KiB Cache, CHS=16709/255/63
> [ 4.565793] hda: cache flushes supported
> [ 4.565846] hda: hda1 hda2 hda3
> [ 4.592183] hda: p2 size 262148670 exceeds device capacity, enabling native capacity
> [ 4.597405] hda: detected capacity change from 137438952960 to 160041885696
This is interesting. I think we should apply this same workaround to
libata if possible.
> So my BIOS is forcing the OS to see not more than 137 GB.
> Someone say that some vendors work this way to avoid non authorized
> hardware.
> However no BIOS update available, no BIOS settings i can tweak.
I think this is a bug in the BIOS, not any intentional restriction.
The HPA is implemented by the drive and the BIOS must temporarily
override it in order to access a recovery partition. If the BIOS uses
LBA rather than LBA48 the drive cannot report its full capacity but will
report the maximum size supported by LBA which is 2^28 sectors (about
137 GB). Then when the BIOS attempts to override any HPA (i.e. make the
entire drive accessible), it actually reduces the accessible size to
this.
[...]
> Ben, kernel team, i only suggest you to add a check in your migration
> script: maybe you can lookup for "Host Protected Area detected" in
> dmesg during the kernel install and, if that string is found, you can
> show a warning message, informing that there can be problem on the next
> reboot. An example:
I don't want to do this. The behaviour should not change. But if we
cannot apply that workaround then I will add some sort of warning.
Ben.
--
Ben Hutchings
Power corrupts. Absolute power is kind of neat.
- John Lehman, Secretary of the US Navy 1981-1987
Attachment:
signature.asc
Description: This is a digitally signed message part