Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2016 09:41:15 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Slawa Olhovchenkov <slw@zxy.spb.ru>, freebsd-hackers@freebsd.org
Subject:   Re: How to safely remove rest of GTP?
Message-ID:  <1483116075.16152.75.camel@freebsd.org>
In-Reply-To: <20161230124407.GN37118@zxy.spb.ru>
References:  <20161230124407.GN37118@zxy.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2016-12-30 at 15:44 +0300, Slawa Olhovchenkov wrote:
> How to safely remove rest of GPT?
> Disk have actual data (part of ZFS), I am don't need to destroy this
> data.
> 
> GEOM: da6: the primary GPT table is corrupt or invalid.
> GEOM: da6: using the secondary instead -- recovery strongly advised.
> GEOM: da22: the primary GPT table is corrupt or invalid.
> GEOM: da22: using the secondary instead -- recovery strongly advised.
> GEOM: da6: the primary GPT table is corrupt or invalid.
> GEOM: da6: using the secondary instead -- recovery strongly advised.
> GEOM: da22: the primary GPT table is corrupt or invalid.
> GEOM: da22: using the secondary instead -- recovery strongly advised.
> 

You need to zero out the backup gpt header.  Geom locates that header
using (mediasize / sectorsize) - 1.  I think mediasize/sectorsize is
exactly what's displayed by diskinfo -v as "mediasize in sectors", so
that number - 1 would be lastsector in:

 dd if=/dev/zero of=/dev/da6 bs=<sectorsize> oseek=<lastsector> count=1

-- Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1483116075.16152.75.camel>