data-recoverybtrfs

Multi-device btrfs with single data mode and disk failure


I had a btrfs partition on a 6 disk array without raid (metadata in raid10, but data in single), and one of the disks just died.

So I lost some of my data, ok, I knew that.

But two questions:

Edit : just to be clear, I can mount it in read only with mount -o recovery,ro,degraded

And btrfs fi df /Data

Data, single: total=6.65TiB, used=6.65TiB
System, RAID1: total=32.00MiB, used=768.00KiB
Metadata, RAID1: total=13.00GiB, used=10.99GiB
GlobalReserve, single: total=512.00MiB, used=0.00B

Solution

  • I'm a very very lucky guy, and I think I fixed my problem (thanks to the help of btrfs mailing list).

    In my situation "btrfs-debug-tree -t 3 /dev/sda6" does not mention the missing disk anywhere (data or metadata). So there was nothing at all in the missing device.

    Thus, patching the kernel with this patch allow me to mount the array in rw in degraded and a simple btrfs device remove missing did the trick.

    So my array is fixed and my data seems fine (scrub in progress)

    One thing I learned though is that the single mode should never ever be used.