How to recover from a BTRFS crash / failure

How to recover from a BTRFS crash?

Short answer: you can't

No, seriously: you can't

It is meant that BTRFS is now more reliable, stable and usable, but is not

I had just a second force shutdown in recent kernels 4.19 and my partition was entirely unreadable, entirely unrecoverable

I have fortunately see very good documentation on internet (so search for these very nice articles on google first) and there's multiple commands for recovery that you can use, none of them worked, none of them was able to fix or mount my partition, all the data was simply, lost

From all the documentations, I was only be able to use btrfs restore this way (and only this way):

btrfs restore -x -m -S -i partition.img /mnt/dir-recover/

Note: I do not suggest to play directly with recovering tools on the affected partition, but to dump its contents to an image file and try to recover it, otherwise, if you fail on the recovery the problem would be worse, imaging the partition allows you to play as many things as you want and recover the original damaged state back as much as you need

This tool, was able to recover only a portion of my files from the filesystem, in a very unreliable way, it was my only way to recover some data from it

Everything else: i needed to search between different computers and random backups and server backuped uploads every usable data, if was not for these, I would have lost 2 months of entire work (except for all the work that is commited on git which is always safe), because my systems were not yet ready to have distributed backuped work recently due to the big movement of new system.

That is why I have been recently away from the forum, I needed to fully concentrate in the recovering of the data and the new systems, I also have recently moved to Colombia where I'm actually writting from, so I will be back soon working on the new 3.7.4 version which accidentally needed to be in pause, and I also need to verify that everything is working back as expected. Later, I will start to answer back in the forum from time to time while waiting processes to finish :slight_smile:

So, don't use btrfs, it is really dangerous, period.

I would need to improve the installer to warn about it and have an extra confirmation.

1 Like

Interesting.....

My Acer Aspire 5310 hasn't be able to finish 3.7.3 installation with BTRFS (more than 15 hours with HDD light working on) and I finally must to stop installation process. With reiser4 installation ran fine.

So, with your experience, do you think that it's really a good idea let it as one alternative to final user even with a twice warning message?

Why not only to not propose it and propose only tested file systems? :work:

And good luck in your new Colombian periods! :boogie:

1 Like

Did you give "testdisk" a go? It'll work on dd images too.
I've never tried it on btrfs but in my case it recovered all the files (including encrypted files) on my corrupted/lost partitions. Actually more than that, as it also recovered more than one instance of certain files . :face_with_hand_over_mouth:

Most of the work consisted of ordering the files properly and recovering only what was needed ...... it was my /home partition, so actually very big.

Good luck.

My 3 systems have been running with reiser4 without a glitch.

May be except for this, that happened recently :

I just bought a 4 TB USB drive ( Passsport drive)

I Shrinked the windows NTFS partiton to 1 GB

Created a 3 TB reiser4 partition

And when playing with a lot of DATA (1-2 gig of large and small files) on the reiser4 3 GB partition, it was horribly slow to Delete a lot of files. I then formated it in EXT4 and it was fast...

But It may be related to the fact that the drive is USB and connected in USB. 2.0 I will make more tests when I have am minute on a SSD driver to see...

But for now, my 2 laptops and Desktop works well with reiser4

ALSO, only for my OS to " load " the empty 3 GB partition was long... And now delay in EXT4... But I did all that so fast that I am may be missing something else in the story...

Maybe not, btrfs is pretty dangerous and of course the day of tomorrow people will blame elive for "losing all its data" (forgetting that they choiced themself btrfs)

there's not much, the only reliable (even if i dont like it much) is ext4

not tried but the problem with that is that is good for recover image files for example, but for "your data" it will be a massive headache to know "what is what and where they comes from"

yeah, if the space of the old files are not overwritten with zeroes or trash data, they are recovered (found) later as usable/existing data

But seems like i was able to recover now, im doing tests of builded isos to compare the final resulting contents too :slight_smile:

im experiencing similar things in an external disk with reiser4 too, slow mounting/umounting and probably slow transfer

im thinking to switch my laptop to ext4 instead, there's also a few difficulties to mount filesystems inside reiser4 (probably reiser4 for root partition and ext4 for home)

Yes, it's so that I mean but I didn't wrote it, I was affrayed to those possibility (people doesn't usually accept their choices and/or their mistakes and they usually find a guilty of their mistakes, and maybe it's very risked at this stade to propose btrfs, maybe in some time, as it will be more stable)

Hoping you've can recover as much as data as possible.... good luck!

for now, my 3 PC ( 2 laptop and main desktop) are suing resier4 and running well
As you mentioned it's a USB, external thing, that seems to be a problem... As it'S working well on my main SSD drive ( Laptop/desktop), I will continue using it.

Due to my " upgrade existing system" I'm using ext4 and cannot see or feel any real difference over btrfs or reiser4 (i've got both systems dual booting on the same machine).
So essentially I'm not sure but do think (due to the articles @Thanatermesis posted) reiser4 is the better option.
About @yoda 's USB experience: I'm not so sure reiser4 itself is to blame, could be the disk not getting registered correctly as a high speed device. That might be caused by reiser4 being there and the firmware not knowing what to do with it.:thinking:

1 Like

@Thanatermesis
I was just unmounting a 1 GB reiser partition on an old USB drive and yes it's slow to " mount or umount" large external USB drive reiser4 partition.

But once mounted, it runs well LOL
But I am reformatting it in EXT4 for now...

As for my SSD drive, still Reiser4 while I have no gliches / problems