Tools to recover data from a BtrFS partition whose first sectors were overwritten

1

The first few GBs of my 300 GB BtrFS partition were overwritten by another file system, so I lost that data. Naturally, now the partition cannot be mounted as BtrFS, so none of the contents which I want to recover can be accessed in a normal way.

However, most of the data is still there, intact. I have already attempted to recover files using Photorec, with some success, and I would like to know about alternative data recovery tools for BtrFS, which may give better results.

What tools do you recommend? Thanks

Tocell

Posted 2017-10-25T01:22:37.683

Reputation: 31

I'd try testdisk, and see if you can't pull the entire partition. – Frank Thomas – 2017-10-25T03:29:44.107

@FrankThomas The tool is not developed in professional way - there are many bugs such as http://www.security-assessment.com/files/documents/advisory/Testdisk%20Check_OS2MB%20Stack%20Buffer%20Overflow%20-%20Release.pdf + full filesystem support is missing (as can be noted within the 7.0 release page, for how the software wasn't working reliably for previous versions: "exFAT: better support" and "ext4: handle 64 bit blocks or 64 KiB blocksize. Fix detection and file listing").

– Kais – 2017-10-27T15:51:56.407

@FrankThomas Moreover, there is few filesystems being supported (or better half-supported): FAT, NTFS and ext4. However other FS are not supported. not to mention the usability, that is very poor, making the process too complicated by having no gui and initially asking the user to "select the partition table type": it is ridiculous .. so testdisk is obviously out of being reliable. – Kais – 2017-10-27T16:24:19.690

@FrankThomas From my own experience, I tried testdisk for recovering an ext4 partition but it didn't work, while another commercial one made me able to see the whole filesystem structure .. – Kais – 2017-10-27T16:24:44.110

Answers

0

You are probably SOL. You MIGHT be able to do something by trying to find the third superblock, but don't hold your breath .

Have look at https://github.com/kdave/btrfs-wiki/wiki/Restore (maybe btrfs -u 2 restore /dev/sdX /path/to/save/filesto to attempt to restore from the second superblock or follow the A"dvanced usage section.

davidgo

Posted 2017-10-25T01:22:37.683

Reputation: 49 152