Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2017 21:31:59 +0300
From:      Volodymyr Kostyrko <arcade@b1t.name>
To:        Chris Ross <cross+freebsd@distal.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: zfs import from old TXG
Message-ID:  <bdece15b-d203-79df-2d10-4fb81154dd4f@b1t.name>
In-Reply-To: <FAE448FC-9A3F-43EE-8DED-963D51E6E158@distal.com>
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> <FAE448FC-9A3F-43EE-8DED-963D51E6E158@distal.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Chris Ross wrote:
>
>> On Aug 13, 2017, at 09:54, Volodymyr Kostyrko <arcade@b1t.name> 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 <device>

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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bdece15b-d203-79df-2d10-4fb81154dd4f>