From nobody Thu Sep 16 23:27:54 2021 X-Original-To: freebsd-current@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 A85E317D6204 for ; Thu, 16 Sep 2021 23:28:05 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9YD53hjgz4t6c; Thu, 16 Sep 2021 23:28:05 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mail-io1-xd2b.google.com with SMTP id f6so10060648iox.0; Thu, 16 Sep 2021 16:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DJKRQ/Jg6Ka59oJZFoTDPSSqrHvPYr0f5DwC78ydBKw=; b=O2mFgANjA3GO7BAqEPb4FBFFawbrUJ/yec2s5xGBPOFvgP1YQAKIusgkrK1LUq97U5 KxZaAwW4qo90iY202ciu+LnTIuIBynBPs6+bH0VEiIxo+ns/N7biH4jF8QcUr8onZ7AO TL+2hBnIW5Gkv7LEqWIpTWmI/xskuhW96yC+d+kD9R3DTWjNoa3cDziNexqBjKfxdRfY QdYN1IZx6TwNIOk1w6x36srJUx0Ki8DUvdqL88M8orrzFdM/9K0BrelRpJIAiURfSKJd WYPB8xb0rixaKPhfRly8sIQmodULuK1QpMXoqdcfZsLwp6o/MLB10n9jclxAguxBPigc EdqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DJKRQ/Jg6Ka59oJZFoTDPSSqrHvPYr0f5DwC78ydBKw=; b=bM3qSO0DtCiVqg6qegJWCxGlFtiYDGiNLYozBJjNNORHQl6JKzKJ7U0osj7/yvO4lZ iN5Qjx6HugKEVTPo93RUIP2dOjFMzvP5B35+9wUXU3oEMMXlJKS+4hcZOz5pbwnJoPGv 6sBRWMVmPY5738h1/YdaO0nlpYCctWy2Lq/GuZMN5jX0alMKt9rv8MlqDMwtHWOHiba1 y5Fr9XQS1nIL1yuTLzT1TWQsK44mKOAd2sB5dGLEVNBrG9grnLjQTgJJAacQEFhtABfN kxBFop+6TP6z1Xhw1tdLQivqKFN9HRjI8BYuithZiCYwdKrszDjwd6Ub2ay5Biw5+Uy6 yzEg== X-Gm-Message-State: AOAM530moBw493J+GwTLENCqNrlDF9CqfZFeBIZS3O1IjkFG4dqTaGiu Dg18Fznvh57nE0ZmQVX1VGyz415D7XLqJZSsyhs= X-Google-Smtp-Source: ABdhPJzzjj8JQq3rS51J+XsscogLJ9I4WpF9AXRjykSBIcz2MnsDe9WlHQEcW8i7zUP1xkdIB/YDRFnOTvbf9ZtSwTA= X-Received: by 2002:a05:6602:2211:: with SMTP id n17mr6259749ion.142.1631834884859; Thu, 16 Sep 2021 16:28:04 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <37A64EF6-C638-41A6-9304-3C11550B811E@yahoo.com> In-Reply-To: <37A64EF6-C638-41A6-9304-3C11550B811E@yahoo.com> From: Freddie Cash Date: Thu, 16 Sep 2021 16:27:54 -0700 Message-ID: Subject: Re: zpool import: "The pool cannot be imported due to damaged devices or data" but zpool status -x: "all pools are healthy" and zpool destroy: "no such pool" To: marklmi@yahoo.com Cc: Alan Somers , freebsd-current Content-Type: multipart/alternative; boundary="000000000000a4ec8605cc252a1d" X-Rspamd-Queue-Id: 4H9YD53hjgz4t6c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000a4ec8605cc252a1d Content-Type: text/plain; charset="UTF-8" [message chopped and butchered, don't follow the quotes, it's just to show some bits together from different messages] On Thu, Sep 16, 2021 at 3:54 PM Mark Millard via freebsd-current < freebsd-current@freebsd.org> wrote: > > > For reference, as things now are: > > > > > > # gpart show > > > => 40 937703008 nda0 GPT (447G) > > > 40 532480 1 efi (260M) > > > 532520 2008 - free - (1.0M) > > > 534528 937166848 2 freebsd-zfs (447G) > > > 937701376 1672 - free - (836K) > > > . . . > > > > So you just want to clean nda0p2 in order to reuse it? Do "zpool > labelclear -f /dev/nda0p2" > > > > >> > >> I did not extract and show everything that I'd tried but > >> there were examples of: > >> > >> # zpool labelclear -f /dev/nda0p2 > >> failed to clear label for /dev/nda0p2 > > The start of the problem looked like (console context, > so messages interlaced): > > # zpool create -O compress=lz4 -O atime=off -f -tzopt0 zpopt0 /dev/nvd0 > GEOM: nda0: the primary GPT table is corrupt or invalid. > GEOM: nda0: using the secondary instead -- recovery strongly advised. > cannot create 'zpopt0': no such pool or dataset > # Sep 16 12:19:31 CA72_4c8G_ZFS ZFS[1111]: vdev problem, zpool=zopt0 > path=/dev/nvd0 type=ereport.fs.zfs.vdev.open_failed > > The GPT table was okay just prior to the command. > So I recovered it. > It looks like you're trying to use a disk partition for a ZFS pool (nda0p2), but then you turn around and use the entire drive (nvd0) for the pool which clobbers the GPT. You need to be consistent in using partitions for all commands. You're also mixing up your disk device nodes for the different commands; while they are just different names for the same thing, it's best to be consistent. GEOM is built out of layers (or more precisely, "containers" as it specifies a new start and end point on the disk), which is very powerful. But it's also very easy to make a mess of things when you start accessing things outside of the layers. :) And ZFS labelclear option is the nuclear option that tends to remove everything ZFS-related, and everything GPT-related; although I've never seen it used on a partition before, usually just the disk. Best bet in this situation is to just zero out the entire disk (dd if=/dev/zero of=/dev/nda0 bs=1M), and start over from scratch. Create a new GPT. Create new partitions. Use the specific partition with the "zpool create" command. -- Freddie Cash fjwcash@gmail.com --000000000000a4ec8605cc252a1d--