[6.11.0] GPT Header Corruption


Go to solution Solved by JorgeB,

Recommended Posts

Today I finally got round to upgrading my server! I've gone from a 3570k to a 12600k on an Asus Z690 motherboard. However, when I boot I get a message stating that GPT header corruption has been found, and to check SATA mode or attempt to repair the boot sector (this isn't my computer, but the wording here is the same or very similar). If I enter setup and immediately quit then my server will boot and Unraid seems to be operating with no issues. However, it's a bit of a pain as I normally run the server headless, and I have to attach monitor and keyboard to be able to boot at the moment. Is there any way to check the GPT headers using Unraid? I don't want to run a tool that 'fixes' the headers only to make the drives unreadable to Unraid.

I don't think there's any useful info, but I've attached my diagnostics file.

tower-diagnostics-20221002-1634.zip

Link to comment

Sorry, I wasn't very clear! It's a message from the BIOS, almost immediately after turning on. I can't post a photo at the moment but it's very similar to the one I linked to above - obviously the processor details are different, but it's at that same point just after POST. I haven't received any errors from Unraid.

Link to comment
12 hours ago, JorgeB said:

The syslog is showing a similar error:

Oct  2 16:19:58 Tower kernel: Alternate GPT is invalid, using primary GPT.

 

But like mentioned not clear which device is the problem, check the output of:

fdisk -l /dev/sdX

for all the devices, it should indicate the culprit

Thanks, I ran fdisk -l and under /dev/sdc1 there's a message saying "the backup GPT is corrupt, but the primary appears OK, so that will be used".

Presumably there's some way to overwrite the backup with the primary? It's an array drive so I'd rather not mess it up!

Link to comment
  • Solution

Find it interesting that the board BIOS checks for that, you should be able to correct that with gdisk, e.g.:


 

gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.5

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: OK
Backup partition table: OK

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.

 

Link to comment
1 hour ago, JorgeB said:

Find it interesting that the board BIOS checks for that, you should be able to correct that with gdisk, e.g.:


 

gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.5

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: OK
Backup partition table: OK

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.

 

Fantastic, thanks a lot for your help (again!). It was actually sdd (my parity drive), I misread which device the error message related to. All seems to be fixed now though - I haven't tried a reboot though as I'm working away this week and I'd rather be there in case I need to attach a keyboard and monitor. It's certainly interesting that the BIOS checks this, but also a bit frustrating - I wasted a lot of time removing sticks of memory etc. as I assumed it was a hardware issue that was preventing it from booting.

Edited by CurlyBen
  • Like 1
Link to comment

So I'm getting the same error message on startup about a corrupted GPT header, however fdisk doesn't show that any of the drives are having an issue. The only thing that mentions GPT is the Disklabel type, which for all drives is showing as GPT.  Looking at the output of gdisk for all the drives I get a message saying "Found valid GPT with protective MBR; using GPT." So as far as I can tell, all signs indicate that there is nothing wrong. Yet I still receive this error. Thoughts?

Link to comment
1 hour ago, Kcirtap1423 said:

if I do find the culprit and run the GPT recovery, will that pose a risk of data loss?

I guess it depends on how you try to fix it, I've used and told other users to use gdisk before to fix and there never was any data loss, but if gdisk doesn't find a problem don't know how you plan to do it.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.