Re: How to roll back btrfs filesystem a few revisions?

Josef Bacik
2020-02-21T23:47:30Z

On 2/21/20 6:17 PM, Marc MERLIN wrote:
> On Fri, Feb 21, 2020 at 03:07:40PM -0800, Marc MERLIN wrote:
>> And now for extra points, this also damaged a 2nd of my filesystems on the same VG :(
>> [64723.601630] BTRFS error (device dm-17): bad tree block start, want 5782272294912 have 0
>> [64723.628708] BTRFS error (device dm-17): bad tree block start, want 5782272294912 have 0
>> [64897.028176] BTRFS error (device dm-13): parent transid verify failed on 22724608 wanted 10005 found 10001
>> [64897.080355] BTRFS error (device dm-13): parent transid verify failed on 22724608 wanted 10005 found 10001
>
> While I'm going to destroy and recreate one of the two filesystems, the
> other one has lots of of btrfs relationships I really don't want to lose
> and have to re-create.
>
> I'm sure it got in a bad state because it got write denied when trying
> to write.
> I don't care about last data written, is there a clean way to open the
> filesystem and revert it a few revisions?
> Basically I want
> git reset --hard HEAD^ or HEAD^^
>
> I'm ok with data loss, I just want to get back to a previous good known
> consistent state. If I've not disabled COW (which I have not), this
> should be possible, correct?
>
> If so, how to I proceed?]

Yeah you can try the backup roots, btrfs check -b and see if that works out?
Thanks,

Josef