From owner-freebsd-hackers@freebsd.org Fri Dec 30 16:41:23 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B66CC96368 for ; Fri, 30 Dec 2016 16:41:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D07DA1887 for ; Fri, 30 Dec 2016 16:41:22 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cbcdc681-ceae-11e6-9357-bffcd86bd944 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id cbcdc681-ceae-11e6-9357-bffcd86bd944; Fri, 30 Dec 2016 16:41:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uBUGfFw1001304; Fri, 30 Dec 2016 09:41:15 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1483116075.16152.75.camel@freebsd.org> Subject: Re: How to safely remove rest of GTP? From: Ian Lepore To: Slawa Olhovchenkov , freebsd-hackers@freebsd.org Date: Fri, 30 Dec 2016 09:41:15 -0700 In-Reply-To: <20161230124407.GN37118@zxy.spb.ru> References: <20161230124407.GN37118@zxy.spb.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:41:23 -0000 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= oseek= count=1 -- Ian