zfs import from old TXG

Chris Ross cross+freebsd at distal.com
Wed Aug 23 18:08:56 UTC 2017


> On Aug 13, 2017, at 09:54, Volodymyr Kostyrko <arcade at b1t.name> wrote:
> 
> Paul Kraus wrote:
> 
>> Using zdb you can examine the TXGs and there is a way to force an import 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 went by on one of the ZFS mailing lists a few years ago. The goal at the time was not to deal with a changed pool configuration but a series of writes that corrupted something (possibly due to a feature being turned on at 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 has gotten easier with `zdb -e -F` … operate on exported pool and rollback TXG until the pool is importable … but I’m 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-day 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 “zpool import -N [-F] -T 7428 tank”.  With or without a -F argument, I get:

cannot import 'tank': one or more devices is currently unavailable

  However, zpool import shows all of its devices ONLINE, and I only exported it a short while ago.  Is there something I’m missing that I can provide to proceed with effectively importing an earlier state of this pool?

  Thanks…

                        - Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20170823/64d825c7/attachment.sig>


More information about the freebsd-fs mailing list