SOLVED the primary GPT table is corrupt or invalid. using the secondary instead -- recovery strongly advise

Status
Not open for further replies.

Kha0sK1d

Cadet
Joined
Mar 19, 2018
Messages
4
I've read the following posts and still am confused about how to fix this...and I currently don't have backups.
https://forums.freenas.org/index.ph...-instead-recovery-strongly.54910/#post-382117
https://forums.freenas.org/index.ph...able-is-corrupt-or-invalid.38445/#post-232964

Error message in nightly email:
Code:
> GEOM: ada3: the primary GPT table is corrupt or invalid.
> GEOM: ada3: using the secondary instead -- recovery strongly advised.
> GEOM: ada4: the primary GPT table is corrupt or invalid.
> GEOM: ada4: using the secondary instead -- recovery strongly advised.


Using FreeNAS-11.1-U1

Hardware:
RAM: 16 GB
Motherboard: Supermicro X10SL7-F
CPU: Intel Xeon E3-1231 v3 @ 3.40GH

The disks in question are part of the game pool, setup in a 2 HD mirror configuration.

zpool status:
Code:
[root@freenas ~]# zpool status																									 
  pool: freenas-boot																												
 state: ONLINE																													 
  scan: scrub repaired 0 in 0 days 00:00:03 with 0 errors on Thu Mar 22 03:45:03 2018											  
config:																															
																																	
		NAME		STATE	 READ WRITE CKSUM																					 
		freenas-boot  ONLINE	   0	 0	 0																					
		  ada2p2	ONLINE	   0	 0	 0																					 
																																	
errors: No known data errors																										
																																	
  pool: game																														
 state: ONLINE																													 
  scan: none requested																											 
config:																															
																																	
		NAME											STATE	 READ WRITE CKSUM												 
		game											ONLINE	   0	 0	 0												 
		  mirror-0									  ONLINE	   0	 0	 0												 
			gptid/1f6d8020-3129-11e8-9e4d-ac1f6b02ef64  ONLINE	   0	 0	 0												 
			gptid/2081bafa-3129-11e8-9e4d-ac1f6b02ef64  ONLINE	   0	 0	 0												 
																																	
errors: No known data errors																										
																																	
  pool: main																														
 state: ONLINE																													 
  scan: none requested																											 
config:																															
																																	
		NAME											STATE	 READ WRITE CKSUM												 
		main											ONLINE	   0	 0	 0												 
		  mirror-0									  ONLINE	   0	 0	 0												 
			gptid/861c6f79-2b92-11e8-8519-ac1f6b02ef64  ONLINE	   0	 0	 0												 
			gptid/87293fe6-2b92-11e8-8519-ac1f6b02ef64  ONLINE	   0	 0	 0												 
																																	
errors: No known data errors																										
[root@freenas ~]#				


  • ad3a/ada4 drives were previously used in a Synology NAS and I did not delete data prior to using them. I created a new volume and dataset via the webgui deleting all previous (unneeded) data.
  • Did SMART long test on both drives and they both passed
  • Populated the dataset with data by copying via samba (source drive was NTFS formatted)
I tried
Code:
gpart recover /dev/ada3
(also ada4) and it said
Code:
recovering is not needed


How do I fix this? I would prefer to not have to backup the data and wipe out the disk, but I could if necessary.
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Did you recently upgrade? If so, please state which versions you upgraded from and to.
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Also, recommend you update to U4. As some of these bugs may have already been fixed.
 

Kha0sK1d

Cadet
Joined
Mar 19, 2018
Messages
4
No upgrades, 11.1-U1 was the original install.

It's strange that when I check gpart status it says everything is ok. I will see if I get another nightly email about it and also look into upgrading.

Code:
[root@freenas ~]$ gpart status			  
Name  Status  Components						 
ada0p1	  OK  ada0							   
ada0p2	  OK  ada0							   
ada1p1	  OK  ada1							   
ada1p2	  OK  ada1							   
ada2p1	  OK  ada2							   
ada2p2	  OK  ada2							   
ada3p1	  OK  ada3							   
ada3p2	  OK  ada3							   
ada4p1	  OK  ada4							   
ada4p2	  OK  ada4							   
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Use gpart show: gpart show ada3.

It's odd that the primary is showing corrupted, usually it's the secondary at the end of the disk. But there could be something else going on.
 

Kha0sK1d

Cadet
Joined
Mar 19, 2018
Messages
4
The output to that is:

Code:
=>		40  5860533088  ada3  GPT  (2.7T)
		  40		  88		- free -  (44K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  5856338688	 2  freebsd-zfs  (2.7T)
  5860533120		   8		- free -  (4.0K)


I've read from a few places that using an existing disk without clearing the GPT beforehand causes this issue. I'm hoping that's the case. https://forums.freebsd.org/threads/gpt-table-corrupt.52102/
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
The output to that is:

Code:
=>		40  5860533088  ada3  GPT  (2.7T)
		  40		  88		- free -  (44K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  5856338688	 2  freebsd-zfs  (2.7T)
  5860533120		   8		- free -  (4.0K)


I've read from a few places that using an existing disk without clearing the GPT beforehand causes this issue. I'm hoping that's the case. https://forums.freebsd.org/threads/gpt-table-corrupt.52102/
That is the only time I have seen the error. I have seen the error many times in my pool over the years when I would put a drive in that had previously been used without being cleaned first.
What I have done to clear the error is to remove the drive from FreeNAS, connect it to my windows system, use diskpart to do a clean on the drive, then put it back in FreeNAS as its own replacement. It shows up as not having been formatted and FreeNAS fixes it right up.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I've read from a few places that using an existing disk without clearing the GPT beforehand causes this issue.
It can, sort of, but the way this is appearing is a little surprising. Your error said
Code:
> GEOM: ada3: the primary GPT table is corrupt or invalid. > GEOM: ada3: using the secondary instead -- recovery strongly advised.

The primary table is at the beginning of the disk, the secondary at the end. So that error says the primary was overwritten, when usually it is the secondary that has a problem.

And then the output from gpart show does not even mention it. Which it would, if it was corrupted.

The partitions appear to have been created through the GUI, so it's not a problem with manual setup. It's possible that error was just from the first time the new disks were connected to the machine, before a pool was created on them. Is that error still appearing in nightly email?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
The partitions appear to have been created through the GUI, so it's not a problem with manual setup. It's possible that error was just from the first time the new disks were connected to the machine, before a pool was created on them.
The times I have seen the error are when I add a drive to my NAS that was previously used in another FreeNAS without being wiped or if I use a drive that was previously GPT formatted by Windows. My experience has been that new (never formatted) drives, MBR formatted drives or drives that have been completely wiped do not cause the error.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
My experience has been that new (never formatted) drives, MBR formatted drives or drives that have been completely wiped do not cause the error.
Agreed. FreeNAS should handle them properly anyway. Otherwise it's a bug that should be reported. But in that case, this error will appear once, and then not again after the drives have been reformatted as part of being made into a FreeNAS vdev.
 
Status
Not open for further replies.
Top