From owner-freebsd-fs@freebsd.org Wed Aug 23 18:38:14 2017 Return-Path: Delivered-To: freebsd-fs@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 29F2ADECDE1 for ; Wed, 23 Aug 2017 18:38:14 +0000 (UTC) (envelope-from arcade@b1t.name) Received: from limbo.b1t.name (limbo.b1t.name [78.25.32.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C10F7E209 for ; Wed, 23 Aug 2017 18:38:13 +0000 (UTC) (envelope-from arcade@b1t.name) Received: from [172.29.1.64] (probe.42.lan [172.29.1.64]) by limbo.b1t.name (Postfix) with ESMTPSA id 1A44B15C; Wed, 23 Aug 2017 21:32:02 +0300 (EEST) Subject: Re: zfs import from old TXG To: Chris Ross Cc: freebsd-fs@freebsd.org References: <3408A832-BF2E-4525-9EAC-40979BA3555B@distal.com> <20170813000323.GC95431@server.rulingia.com> <5B508AED-4DAC-42E4-8C56-4619C0D1A1C6@distal.com> <035BFBCB-BA43-4568-89E9-8E8DCDFAA8CA@kraus-haus.org> <928F1F16-0777-4D66-BD27-8224DF80363C@distal.com> <06EEEF86-E466-44EA-86F1-866DA32DD92D@kraus-haus.org> <1d3771a3-9c3a-1af9-9c48-032a01629630@b1t.name> From: Volodymyr Kostyrko Message-ID: Date: Wed, 23 Aug 2017 21:31:59 +0300 User-Agent: Mozilla/5.0 (X11; DragonFly x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=b1t.name; s=dkim; t=1503513123; bh=txy4pD/Bsiwi+Heehf9SszIgu6de48fDIQEX/wzRP30=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=TM+sS7wnXOY47yuJZTZRP+SrEBmn5cnlMO/CM3BuZ3vvPJ6FOTy04ThMIrzx5kWRvHkHvLxsW4sXESvfsuN8TwvOlpbZsZW7Lcwz9feB6U5uI3G3m4gwViuqY2i1bq6bjDgQ4t1PcTxhEYMfGgJxZBxtIALBhgv5gNbPySpoM2U= X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 18:38:14 -0000 Chris Ross wrote: > >> On Aug 13, 2017, at 09:54, Volodymyr Kostyrko wrote:= >> >> Paul Kraus wrote: >> >>> Using zdb you can examine the TXGs and there is a way to force an imp= ort to a certain TXG (at least under Illumos there is, I assume the FBSD = ZFS code is the same). I do not remember the specific procedure, but it w= ent by on one of the ZFS mailing lists a few years ago. The goal at the t= ime was not to deal with a changed pool configuration but a series of wri= tes that corrupted something (possibly due to a feature being turned on a= t a certain point in time). You would lose all data written after the TXG= you force the import to. >>> >>> Looking at the manpages for zpool and zdb, it looks like doing this h= as gotten easier with `zdb -e -F` =E2=80=A6 operate on exported pool and = rollback TXG until the pool is importable =E2=80=A6 but I=E2=80=99m sure = there are limits :-) >> >> That's -T, it was intentionally left undocumented. >> >> /usr/src/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c /starting txg= > > Looking back at this, and trying to recover some data without multi-d= ay clean/restore cycles. I want to import my pool to an earlier txg. I = used zfs history to log the actions, and am trying to use =E2=80=9Czpool = import -N [-F] -T 7428 tank=E2=80=9D. With or without a -F argument, I g= et: > > cannot import 'tank': one or more devices is currently unavailable > > However, zpool import shows all of its devices ONLINE, and I only exp= orted it a short while ago. Is there something I=E2=80=99m missing that = I can provide to proceed with effectively importing an earlier state of t= his pool? Available transactions can be listed with: zdb -ul I can't remember how long it takes to overwrite old transactions but if=20 the pool was imported more then a few hours after the disk was added=20 older transactions would already be overwritten... PS: If not minutes. --=20 Sphinx of black quartz judge my vow.