The primary GPT table is corrupt, but the backup appears OK, so that will be used.

TechnoJunky

Well-Known Member
Joined
Dec 3, 2018
Messages
501
Reaction score
400
Credits
398
I have a raid 5 setup. When I do an fdisk -l, it returns, for each of the drives, "The primary GPT table is corrupt, but the backup appears OK, so that will be used.". I've done some searches on how to restore the backup to the primary, but haven't turned up anything. The best I could find was using testdisk but not really sure what I'm doing there. When I tell it to Analyze, it returns this for SDA (all 3 disks are identical):
Code:
Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

Bad GPT partition entries, invalid checksum.
Trying alternate GPT
After clicking enter, it scans the cylinders and returns this:
Code:
Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63

The harddisk (1000 GB / 931 GiB) seems too small! (< 2000 GB / 1862 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partition can't be recovered:
     Partition               Start        End    Size in sectors
>  MS Data                   264192 3906785279 3906521088

Then finally, the next screen gives me this:
Code:
     Partition               Start        End    Size in sectors
>D MS Data                     2046 1953523709 1953521664
 D MS Data                 42240256  126126335   83886080
 D MS Data                227179107  227181986       2880 [NO NAME]
 D MS Data                235568683  235571562       2880 [NO NAME]
 
 Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
                P=Primary  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 1000 GB / 931 GiB

I tried Load Backup, but it said there was none.
It gave the option to do a deeper dive, which I took but didn't give anymore usable info than the above.

Code:
Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63

The harddisk (1000 GB / 931 GiB) seems too small! (< 18446727 TB / 16777200 TiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partitions can't be recovered:
     Partition               Start        End    Size in sectors
>  MS Data                   264192 3906785279 3906521088
   MS Data                 62461950 3837499389 3775037440
   MS Data                 62461952 3837499391 3775037440
   MS Data                973377776 2926899439 1953521664
   MS Data                973377872 2926899535 1953521664
   MS Data                973377968 2926899631 1953521664
   MS Data                973378064 2926899727 1953521664
   MS Data                973379360 2926901023 1953521664
   MS Data                973379496 2926901159 1953521664
   MS Data                973379632 2926901295 1953521664

[ Continue ]
ext4 blocksize=4096 Large_file Sparse_SB Recover, 2000 GB / 1862 GiB

Any help would be greatly appreciated. Everything else seems to be working as I would expect it to.
 


You can try this.

sudo sfdisk -d /dev/sda > PT_gpt-table.txt

Then try the "L" (load back-up).

I have to say it seems really unlikely that that all three disks would be corrupted.
If that is true, I'm not sure how it can recover the checksum.
If you do have a bad disk... how can it recover the parity?
 
Rand the sfdisk command, output was "The primary GPT table is corrupt, but the backup appears OK, so that will be used." The file contained this:
label: gpt
label-id: 50CB1913-6962-4AEB-BF5E-F37FCA513B93
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 1953525134

I don't believe the disks are corrupted as much as I may have done something wrong when setting things up. I tried the L option, but it said there were no backups.
 
The bad GPT is coming from the Raid array itself. I removed SDA from the raid array, created a new partition table, checked 'fdisk -l' and saw the bad primary error was gone. Added the disk back into the array and it now shows the error again.
 

Members online


Latest posts

Top