From nobody Tue Apr 11 13:24:57 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PwmmR3gBMz44s3b for ; Tue, 11 Apr 2023 13:25:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PwmmR2x5Cz41kn for ; Tue, 11 Apr 2023 13:25:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x635.google.com with SMTP id kt17so8128054ejb.11 for ; Tue, 11 Apr 2023 06:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1681219508; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fqXCZdOTsDfw6BZ9Dz00UdchOQaCUOa9UvG/6tl8zrg=; b=aSMVX/9+xAaQXJa3te4CIKE2Ur71zZe4Q4AGWH3og3gghOtLRKTe4uhRp+aIxOrZjq PrGAoIi+B+nB4IgalsVG9AUiZEuUtefyp45Naam90qokQdcmpokQf+aNwOPBKCHeH7Zi 7QpRBp6wGUQDXlyQy+PFAQzx2nfi+Gg2CjSnGG5BGxPsrZ+GRHQKe+jdQgmMGuvLjfzq G33cyTNmSoco4Y19GtbgkN/tajJEVCj4wixOcNDQNTSmErGz1fBQvYQjZ4m81QEmWPP9 1n0sJy9XyxKm/ZkpFYHIXPgF2UgE+/puS28r+t9G4Gk0HZWR1OfxLPJByde6xCuKwSXp QqAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681219508; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fqXCZdOTsDfw6BZ9Dz00UdchOQaCUOa9UvG/6tl8zrg=; b=YKPklITwl/B5PZeiPMspGRy37zJlji4v05rgNoOFivR36MO5AaaLxAvtgkD3Yj/N1i gamOxgc9xFMK+51VinHoMKsX5nusP3PLdHgTIfanQK6Ehy87pSC4cSFmmL4xUAvpB4yY kIzSqxY9U84l9WrNq7UTDeD6Rqss2u7A8O7WYvEHUBWfAY4psld+QuGsmOQ84M4DLURt 2HCCodCeVFeTAYcevRt00oTMbmKhaUphCwdf6VFmZSjnPvgyyBTUIs13x20oh5UVFZK3 cWAVw7MHT1xbY2S4Qj3T59mXL9hzMEYW9QX8MAIg+N00feB0jMfMhp3wso+36QZ+02nQ Ugjw== X-Gm-Message-State: AAQBX9dYafmvtHPCcURMDj7hr3BtL+A0EjU+QGrKVn0E8BJ6dm/gkz9n YDlXjZ1eEQknkANGaCG/vZ6l6AyoDZUrHOytxCS32NPDs6+YcmB4 X-Google-Smtp-Source: AKy350YGC5zmi3cQ6S1c92DU2Wwtrui3eMKY4W59bb7/HgMh9G513Z2j6BLRC5EM9RHbmaP8TNYR1KfJg9jktEBTGlc= X-Received: by 2002:a17:906:d78a:b0:93d:a14f:c9b4 with SMTP id pj10-20020a170906d78a00b0093da14fc9b4mr4412327ejb.2.1681219508338; Tue, 11 Apr 2023 06:25:08 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <64e88636-1e03-7ff5-7d3f-e8a36117cdbe@freebsd.org> In-Reply-To: <64e88636-1e03-7ff5-7d3f-e8a36117cdbe@freebsd.org> From: Warner Losh Date: Tue, 11 Apr 2023 07:24:57 -0600 Message-ID: Subject: Re: gpart destroy, in depth To: Graham Perrin Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="00000000000095986605f90f6be8" X-Rspamd-Queue-Id: 4PwmmR2x5Cz41kn X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000095986605f90f6be8 Content-Type: text/plain; charset="UTF-8" It writes zeros to the partition table. Warner On Tue, Apr 11, 2023, 7:13 AM Graham Perrin wrote: > Please: what, exactly, occurs when a partition table is destroyed by > gpart(8)? > > Background: a customer was 100% certain that no data was required from a > hard disk in an iMac that will be disposed of. I booted from a USB drive > with FreeBSD 14.0-CURRENT, then lazily ran gpart destroy for the > internal disk (probably ada0). A few hours later, the customer realised > that the disk probably held a few years' worth of important emails. > > I don't intend to attempt recovery, or recreation of the partition > table, but I'd like to provide enough technical information for a third > party to advise the customer whether doing so will be economically viable. > > (I see files such as lib/geom/part/geom_part.c and > sys/geom/part/g_part.c, but I have no idea how to interpret them.) > > Thanks > > < > https://github.com/freebsd/freebsd-src/blob/main/lib/geom/part/geom_part.c > > > > > > --00000000000095986605f90f6be8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It writes zeros to the partition table.
=
Warner

On Tue, Apr 11, 2023, 7:13 AM Graha= m Perrin <grahamperrin@freeb= sd.org> wrote:
Please: what,= exactly, occurs when a partition table is destroyed by
gpart(8)?

Background: a customer was 100% certain that no data was required from a hard disk in an iMac that will be disposed of. I booted from a USB drive with FreeBSD 14.0-CURRENT, then lazily ran gpart destroy for the
internal disk (probably ada0). A few hours later, the customer realised that the disk probably held a few years' worth of important emails.

I don't intend to attempt recovery, or recreation of the partition
table, but I'd like to provide enough technical information for a third=
party to advise the customer whether doing so will be economically viable.<= br>
(I see files such as lib/geom/part/geom_part.c and
sys/geom/part/g_part.c, but I have no idea how to interpret them.)

Thanks

<https://git= hub.com/freebsd/freebsd-src/blob/main/lib/geom/part/geom_part.c>

<https://github= .com/freebsd/freebsd-src/blob/main/sys/geom/part/g_part.c>

--00000000000095986605f90f6be8--