From owner-freebsd-current@freebsd.org Tue Oct 4 18:53:25 2016 Return-Path: Delivered-To: freebsd-current@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 173A4AF5CDF for ; Tue, 4 Oct 2016 18:53:25 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D22E0797 for ; Tue, 4 Oct 2016 18:53:24 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22e.google.com with SMTP id r30so37700432ioi.1 for ; Tue, 04 Oct 2016 11:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zlMvuL3grOV/njxdiaW1nuss9YiUKTYj8/A8pn6MwO4=; b=Ir+Xu1KmwbTZbfS5XKwkV80nc3NZcpEFBSfS8LF7f8WJR0fbVI6NhwC4XyFvbMVPOV UTOoUjGF35uiOd3G1LSoyIMPH81KVAAeBvcunqPw141iAKjonIjte9FHv8YBZrYFmYVA BCCY45TCJQauHuHA799+IoVZnDVFZ+3FDpdOouKO3mHUA6AJB01cboLBlvZAjHwOJb/M N/HbgSs+j2buWGqg1x86mT472NBs6OeFbDfGVn3srXxw8KOB2ajhoJ/zA+jOP1m2wvv9 g61GgahgkYn12lMtNbzgKxMKw0pR/myPGfqd3dKnSnUq2GPf7/QHoL9QacgfZOnM+8B0 rIkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zlMvuL3grOV/njxdiaW1nuss9YiUKTYj8/A8pn6MwO4=; b=RwXxkW3z+MwhDZU8dDM5v9N+qscDFLRydmcOAbkn5cjJct9/DO68OIl2Uk2gKB7aae Dr3bKOWAwUUeTjfWxnRyFiCSIK0hzgCnJhsYoIzljZlsMw+RdUuUQErDA0Zgbq5ky5Rh mz1goP1lCMLULAFj+StAlRETpHoYDTbU0kmXqxHefLZIcgiX8qLD3WwR0pA9gAdFhqkb fUw/k6/gtV7A4iBN60/7Sixr3lm7dK3lbjDzNRTrcqnceNs39FHdhWHjsGcYwUhCQ1tm 41DjHCCA04xQ59+AYU7A+spRJJqQ6iVZ2W7vKZTavt/MbmcJbjQPDdzcpXAm9lFVwQ4G 85Ew== X-Gm-Message-State: AA6/9RkDrAkL+8LatHYiJEQg18axqjgJtmLHiUGJxsLfJy7wFXGQeS1QCiNmf+1jryshduyWZ17+/Uxwql4Zu7gl X-Received: by 10.107.32.75 with SMTP id g72mr6798488iog.136.1475607204129; Tue, 04 Oct 2016 11:53:24 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.149.196 with HTTP; Tue, 4 Oct 2016 11:53:23 -0700 (PDT) In-Reply-To: <16661613.eI4FiDRTSB@ralph.baldwin.cx> References: <20160926150109.0d0d793e@hermann> <1785064.lgVzRW13Wf@ralph.baldwin.cx> <16661613.eI4FiDRTSB@ralph.baldwin.cx> From: Maxim Sobolev Date: Tue, 4 Oct 2016 11:53:23 -0700 X-Google-Sender-Auth: p0AURsMFc27KcqC6BrqomMc0uHU Message-ID: Subject: Re: Destroy GPT partition scheme absolutely, how? To: John Baldwin Cc: Warren Block , FreeBSD Current , Ngie Cooper , Ernie Luzar , "Hartmann, O." Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2016 18:53:25 -0000 For the whole disk destruction, hopefully one day we'd have BIO_DELETE coalesce code, so that you can batch of lot of operations into handful SATA commands. I've heard rumours imp@ was doing something along those lines. As well as SSD disks smart enough to process those requests in the background. Anyway, just saying. ) -Max On Tue, Oct 4, 2016 at 10:24 AM, John Baldwin wrote: > On Tuesday, October 04, 2016 06:23:26 AM Warren Block wrote: > > On Mon, 26 Sep 2016, John Baldwin wrote: > > > > > On Tuesday, September 27, 2016 12:36:22 AM Ngie Cooper wrote: > > >> > > >>> On Sep 26, 2016, at 22:48, Ernie Luzar wrote: > > >> > > >> ... > > >> > > >>> This little script has been posted before. Maybe it will be what > your looking for. Called gpart.nuke > > >>> > > >>> #! /bin/sh > > >>> echo "What disk do you want" > > >>> echo "to wipe? For example - da1 :" > > >>> read disk > > >>> echo "OK, in 10 seconds I will destroy all data on $disk!" > > >>> echo "Press CTRL+C to abort!" > > >>> sleep 10 > > >>> diskinfo ${disk} | while read disk sectorsize size sectors other > > >>> do > > >>> # Delete MBR and partition table. > > >>> dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} count=1 > > >>> # Delete GEOM metadata. > > >>> dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} oseek=`expr > $sectors - 2` count=2 > > >>> done > > >> > > >> Why not just use "gpart destroy -F provider"? > > > > > > That doesn't always work. In particular, if a disk was partitioned > with GPT > > > and then you use normal MBR on it afterwards, the 'gpart destroy -F' > of the > > > MBR will leave most of the GPT intact and the disk will come up with > the old > > > GPT partitions, not as a raw disk. > > > > Right. So do a gpart destroy -F of whatever is on there, ignoring > > errors, then a gpart create -s gpt. Now there is definitely a secondary > > GPT, and a final gpart destroy -F removes it cleanly. > > It is usually simpler to just dd zeroes over the first N and last N > sectors. > The only fool-proof way to ensure you don't have dangling tables in the > middle of the disk is to zero the entire disk, but that takes too long. > > -- > John Baldwin > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > >