On Wed, Dec 4, 2019 at 5:34 PM Gard Vaaler <gardv@xxxxxxxxxxxxx> wrote: > > > 4. des. 2019 kl. 22:09 skrev Chris Murphy <lists@xxxxxxxxxxxxxxxxx>: > > There's a decent chance this is the cause of the problem. That kernel > > does not have the fix for this bug: > > https://www.spinics.net/lists/stable-commits/msg129532.html > > https://bugzilla.redhat.com/show_bug.cgi?id=1751901 > > > > As far as I'm aware the corruption isn't fixable. You might still be > > able to mount the file system ro to get data out; if not then decent > > chance you can extract data with btrfs restore, which is an offline > > scraping tool, but it is a bit tedious to use. > > https://btrfs.wiki.kernel.org/index.php/Restore > > That was my first thought too, but it seems too coincidental that I should happen across this bug at the same instant as my cache device failing. btrfs-restore doesn't like my filesystem either: You know, I totally glossed over the cache device failing part of the very first message 8-\ But yeah it would seem like the cache device dropped a bunch of metadata. Really a lot more than I'd expect from the aforementioned kernel bug. So chances are your suspicion is spot on. > > [liveuser@localhost-live btrfs-progs-5.4]$ sudo ./btrfs restore -Divvv /dev/bcache0 /mnt > > This is a dry-run, no files are going to be restored > > parent transid verify failed on 3719816445952 wanted 317513 found 313040 > > parent transid verify failed on 3719816445952 wanted 317513 found 308297 > > parent transid verify failed on 3719816445952 wanted 317513 found 313040 > > Ignoring transid failure > > leaf parent key incorrect 3719816445952 > > Error searching -1 You might have to to try a lot of the btrfs-find-root block addresses (start with highest transid working down) with btrfs restore -t option to force it to use older roots. Maybe one of them will be intact. It's also possible to isolate to a subvolume, if you have home on a subvolume for example. Unfortunately btrfs restore isn't a simple scraper, it doesn't iterate. You have to do that part. It is tedious. -- Chris Murphy
