[mythtvnz] A brief story of Gigabyte motherboards, HPA, disappearing partitions, and shrinking disks...

Mark van Dijk mark.van.dijk.74 at gmail.com
Thu Mar 13 20:05:33 GMT 2014


Hi all,  thought I'd describe a problem that I had last night with my Myth
box just in case anyone else gets a similar issue in the future.  This
issue doesn't really have anything specifically to do with MythTv.

It is all fixed now, but it had me quite confused for a while...

So i have an old Gigabyte motherboard (this relevent) running a fairly
recent and clean install of Mythbuntu 12.04 LTS.  I have a 3TB drive
dedicated to my recordings, and a separate (much smaller) system drive.
The 3TB drive is formated as a GPT drive with a single large XFS partition.

So a few days ago, I was getting annoyed by continuous reminders of various
Mythbuntu updates, so I opened a console and did:
    sudo apt-get install update
    sudo apt-get install upgrade

Among many other things, it updated the kernel.  I was recording stuff at
the time, so didn't bother rebooting for a few days - until last night...

So i rebooted.  When the system came back up, I was warned that my 3TB XFS
partition was not able to be mounted.  This has happened to me once before
just a few days after i completely reinstalled Mythbuntu last year.  At
that time I didn't look into the issue and I simply formatted the drive and
reinstalled the OS - this time i wanted to find out more...

I opened up GParted.  It clearly showed that my 3TB device (/dev/sda) had
no partitions on it at all.  Weirdly, the size of my 3TB drive was being
reported as 2TB.

I then used 'sudo gdisk /dev/sda' to have a closer look.  It saw that there
was a protective MBR block, and it spat out a number of errors talking
about corrupted GPT headers, CRC mis-matches, and that the size of the
end-sector is greater than the physical size of the disk.  Gdisk also
seemed to believe that my disk was only 2TB.

My initial theory at this point was that some GPT unaware system app had
overwritten the GPT header on the disk with some MBR data.  Problem was
this theory is that it doesn't explain why the disk was only appearing as
2TB to the OS.  I did try to get gdisk to copy the backup GPT table to the
beginning of the disk, however (thankfully) gdisk refused due to the backup
GPT table being corrupted.  Had i been successful in copying this backup
GPT table, i believe i would have hosed the filesystem.

At this point, i did some researching on the internet.  I now believe that
the issue is something to do with HPA (Host Protected Area), where the
motherboard 'steals' the last few megabytes of the disk to store a backup
copy of the BIOS.  The physical size of the disk is then reported to the OS
to be slightly smaller than it actually is.  Problem is, on older Gigabyte
motherboards there is a bug in this that causes 3TB drives to look like
only 2TB drives.

Anyway - just as I had found this HPA information on the internet, i
happened to do another apt-get install update/upgrade/reboot.  The one ALSO
included a new kernel.  When the machine came back up - my 3TB partition
was back again!!  I hadn't actually done anything at all to fix it.  I
unmounted the disk and ran xfx_repair - it found zero issues.  The disk and
all the data are just fine.

There are still a number of questions I have.  The HPA feature, as i
understand, is a BIOS/hardware thing, however it appears that the
particular kernal that i was running for those few hours last night was
affected by it - why does the newer kernal work fine?  There are also some
references on the internet on passing an option when starting linux to
ignore the HPA feature - but then other references on the internet seem to
indicate that that is a bad thing to do.

Anyway - maybe this lengthy post might help someone in the future with a
similar problem...

:-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/mythtvnz/attachments/20140314/a9e4c83a/attachment.html>


More information about the mythtvnz mailing list