Corrupt GPT on ZFS full-disks that shouldn't be using GPT

Warren Block wblock at
Sun Jun 28 06:26:06 UTC 2015

On Sat, 27 Jun 2015, Chris Stankevitz wrote:

> I have 11 drives in a zpools.  The zpool is using the drives.  i.e. I
> used "zpool create da1 da2 da3 ... daN".  The zpools are running well.
> In a former life, each of these these drives held two gpart
> partitions.  Apparently I did not "gpart destroy" these drives before
> creating a zpool out of them.
> Now when my computer boots,
> 1. the zpool comes up and is healthy
> 2. ls /dev/daX* does not show any of the "old" partitions.
> 3. dmesg reports "the primary GPT table is corrupt or invalid" and
> "using the secondary  instead -- recovery strongly advised."
> Q: Am I in danger of GPT wrestling control of the drive away from ZFS

No, but I would want to fix it so it doesn't surprise me at some 
inopportune later date.

> Q: How can I remove the secondary GPT table from each of the drives
> that are participating in the zpool?  I suppose I could offline and
> resilver each of them.  I'm afraid to dd the secondary GPT header at
> the last 512 bytes of the drive.

Erasing just the last block would probably be enough.  Still, the only 
reason to be afraid of it is if you do not have a full backup.  And if 
you don't have a full backup, that is the first thing to do.

> Perhaps there is a way I can ask ZFS
> to do that for me?

Not that I know of.  If the backup GPT were in an area that ZFS writes, 
it would have been overwritten when the ZFS label was installed.

Here is the forum thread where I show the math about erasing the backup 

More information about the freebsd-questions mailing list