From owner-freebsd-hackers@freebsd.org Mon Jan 30 15:55:41 2017 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 404D1CC855B for ; Mon, 30 Jan 2017 15:55:41 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F1112D; Mon, 30 Jan 2017 15:55:40 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v0UFtdGg096595 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 08:55:39 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v0UFtc9E096592; Mon, 30 Jan 2017 08:55:38 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Mon, 30 Jan 2017 08:55:38 -0700 (MST) From: Warren Block To: "Andrey V. Elsukov" cc: Slawa Olhovchenkov , freebsd-hackers@freebsd.org Subject: Re: How to safely remove rest of GTP? In-Reply-To: Message-ID: References: <20161230124407.GN37118@zxy.spb.ru> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Mon, 30 Jan 2017 08:55:40 -0700 (MST) 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: Mon, 30 Jan 2017 15:55:41 -0000 On Fri, 30 Dec 2016, Andrey V. Elsukov wrote: > On 30.12.2016 15:44, 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 may try attached patch, I did only basic tests, so first try somewhere :) I really like the idea of gpart being able to remove the secondary GPT, but combining it with the existing destroy command is ambiguous. It's hard for the user to tell what will happen, and the command itself implies that it will destroy all partitioning. A different command or option name, maybe, but it's hard to think of a good name on a Monday morning. Certainly the problem of stale secondary GPTs comes up a lot.