Comment 41 for bug 477430

Revision history for this message
juanmatias (juanmatias) wrote :

Ok, dudes.

Finally I SOLVED my issue. I'll post this info here 'cos if this is the cause for your problem then is not a GRUB's bug.

I read a reported issue with the HPA in the disk. Shortly, seems to be that a some motherboards write a copy of the BIOS (or something like this) in a low area of the disk. Then, since it used some space tries to write the correct amount of usable space. For example, if the MB used 1Mb then corrects the HDD size to be 1Mb smaller. This seems to be common with Gigabyte MB (which have XpressRecovery).

Ok, I have an ASUS mother, which doesn't write to HPA. But my HDD was used in a GB MB previously and despite I already deleted all the partitions and formated the unit seems to be that the problem was still there.
I used to check it hdparm utility:

I ran this command (my disk is /dev/sda)

    hdparm -N /dev/sda

This is the result:

   /dev/sda:
    max sectors = 1953525168/1953525168, HPA is disabled

As you can see HPA is disabled. Anyway I tried to apply the solution as if HPA were enabled, which is re write the visible sectors of the disk again on it. In this case:

    hdparm -N p1953525168 /dev/sda

(don't forget the "p" in front of the number, it makes the change permanent)

Then I rebooted my PC and the POST message of BIOS reported my disk as 1TB.

So what I think. The motherboard (in this case the previous Gigabyte used with my disk) wrote the HPA. Despite I repartitioned and formated the disk, something remained in the unit reporting to the BIOS a wrong capacity (I read that in Windows the OS itself could have problem reading this value, does it read the value from the BIOS? I don't know). In my GNULinux I got the correct capacity since the OS read this value in other way (does it count the sectors or something else? I don't know). So, if you rewrite this value with hdparm (or use other apps such HDAT2 or "HDD capacity restore tool", I didn't test these apps, I used hdparm only) the disk should report the correct amount of sectors to BIOS.

Ok, I hope this info will be useful for a lot of people and I insist, if this is the problem (thanks Gigabyte Motherboard for my time researching ;) )it is not a GRUB's bug.

Regards.