From owner-freebsd-geom@FreeBSD.ORG Fri Sep 28 22:22:03 2012 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00E9106564A for ; Fri, 28 Sep 2012 22:22:03 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3578FC0A for ; Fri, 28 Sep 2012 22:22:03 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q8SMLvUu020507 for ; Fri, 28 Sep 2012 16:21:57 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q8SMLutE020504 for ; Fri, 28 Sep 2012 16:21:57 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 28 Sep 2012 16:21:56 -0600 (MDT) From: Warren Block To: freebsd-geom@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Fri, 28 Sep 2012 16:21:57 -0600 (MDT) Subject: Simple way to clear arbitrary drive metadata? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2012 22:22:03 -0000 Last night, I found that the remnants of a GPT backup table on an MBR drive prevented it from booting. When reusing drives from old mirrors, old mirror metadata can be a problem also. And there may be old hardware RAID metadata at the end of the drive. It would be great if dd understood negative seek values. This would get most of that old metadata: dd if=/dev/zero of=/dev/ada8 seek=-34 ...but dd does not understand negative seek values. (Been on my list for a while to look at that.) Which leaves things like diskinfo ada8 | cut -f4 (subtract 34) dd if=/dev/zero of=/dev/ada8 seek=(calculated value) That can be done in one command line with bc and backticks, but it's not clear or elegant. gpart can clear secondary GPT tables, but I'm pretty sure it won't wipe out that space unless it actually is a GPT table. Likewise with glabel and gmirror, they're safe because they only touch data they understand. Is there something simpler and more blunt?