From nobody Tue Jul 20 00:06:10 2021 X-Original-To: freebsd-fs@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 F1D34127783E for ; Tue, 20 Jul 2021 00:06:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 4GTJsV6QPFz3GWB for ; Tue, 20 Jul 2021 00:06:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f178.google.com with SMTP id u11so22727617oiv.1 for ; Mon, 19 Jul 2021 17:06:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oQocqe/FNFYrjC/ybe0nesSqC8831c4VtS3+ECpVp9Y=; b=pkM8UTI/7FfbwNSIwVSQ4n5RqqllgnKDAh6MsWxJysEMwU9bMGp6OVZ3L3q8bUxSTb /YsQuJ/7whrGB2bNl+MxpcMT0ZRFXqtxitmjE1s7hm1mLi4RUAs+y6vawA5NqEDFjBKS WTs/Hpkhp7JKUKSAf9f6ceVXu56RdRTmqCEczyceRsBYh9Vth4e7ufw7CyP7wle11AVN vXZl+w9hezc2L0Hyh0ooU2uD+Y/sHb2uq5uwqWp8NrwPT/Un03WoK6Dk1NdFBI+EPHnQ yY0VySQvox0SkEwbtZQZQmpLL6t+5vi0Jk+Q0QHI66WW07K2AA5EYZKyYefp32FeTu/V lTCA== X-Gm-Message-State: AOAM5330daU2i2UwzDaRrY/zF4NNR9n0p82kEyHuR3CYK3z8m3Qnx7Tz djP7Vf0XhI4HApIGEm287QRQgxPxDpyxcurkEXGNifNQNXo= X-Google-Smtp-Source: ABdhPJw7e1evmyLM931gDKK7F+COnB02lM5O7INyMPOcGgRVgxBNCB77yCKACxwxIj+vlCy30/1yByC+y5iH4VgpEMk= X-Received: by 2002:aca:2308:: with SMTP id e8mr16282653oie.57.1626739581562; Mon, 19 Jul 2021 17:06:21 -0700 (PDT) List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Mon, 19 Jul 2021 18:06:10 -0600 Message-ID: Subject: Re: ZFS pool export question To: joe mcguckin Cc: freebsd-fs Content-Type: multipart/alternative; boundary="000000000000e6b57105c782d249" X-Rspamd-Queue-Id: 4GTJsV6QPFz3GWB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000e6b57105c782d249 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 19, 2021 at 5:58 PM joe mcguckin wrote: > I want to have a disk that I can transfer files between ZFS systems. I > created a pool with one disk: > > zpool create xfer da9 > > Ok, everything seems to be ok. This is a drive that had a GPT label and 1 > freebsd-zfs partition labelled with the drives serial number. > > I want to remove the drive; > > zfs umount /xfer > zpool export xfer > > Now I get error messages about a damaged and possible unrecoveracle GPT > label. > > Am I going about this in the right way? I can=E2=80=99t simpply remove th= e drive > after unmounting it, then ZFS prints errors about a failed VDEV. > > Help obi-wan=E2=80=A6 > When you created the pool, you used the whole disk "da9", not the first partition "da9p1". So ZFS overwrote the GPT label. But GPT keeps a backup label in a location that ZFS didn't overwrite, which is why you now have a "damaged" GPT label instead of a "nonexistent" one. If you really want to have a GPT-formatted disk, you should destroy your pool, recover the label with "gpart recover da9", then recreate the pool. Or, you can just forget about GPT; you don't need it. To do that, do "gpart destroy -F da9". That might also wipe out one of your ZFS labels; I'm not sure. But like GPT, ZFS keeps redundant copies of the label. Oh, it's also unnecessary to do "zfs umount" each time. "zpool export" will do that automatically. -Alan --000000000000e6b57105c782d249--