How to restore from truncated btrfs?

1

I'm suffering from the combination of two issues:

  • after changing the HDD enclosure once and changing back to the initial enclosure (and others in order to test), a 5TB btrfs is now truncated after 2TB and can't be mounted anymore (based on 2TB I assume that a faulty Linux kernel hasn't recognized GPT correctly or that I missed something else and written the tail of a partition onto the disk)
  • the HDD is partly damaged with > 8000 damaged blocks which can't be read (according to multiple runs of ddrescue

Even the tiniest error causes a bad block failure of btrfs check on both the HDD and the ddrescue image so that resizing won't work because mounting requires fixing the fs errors and btrfs restore doesn't accept the complete device as input. btrfs restore fails with

leaf parent key incorrect 29425664
Error searching -1

I assmue after reaching the device border looking for data outside the 2TB border.

I'm using btrfs-progs 4.2.3 Ubuntu 15.10 with Linux 4.2.5.

Karl Richter

Posted 2015-11-01T11:11:55.963

Reputation: 1 641

So switch back to the old enclosure? Apparently the new one can't handle more than 2 TB. – psusi – 2015-11-01T14:09:12.270

That wasn't precise from my side. I used the enclosure only once when the truncation must have happened. Meanwhile I'm using the initial and tested others as well. The truncation seems to be final, though. – Karl Richter – 2015-11-01T15:42:24.360

Where are you getting the size from? What does parted print show? – psusi – 2015-11-01T15:57:30.143

No answers