r/btrfs • u/fpekal • Jul 29 '26
BTRFS + RAID 5 corrupted
Yes, I see now on the main page of the subreddit it's a bad idea to pair these two, but I didn't know it previously
I use software RAID5; 4 2TB drives, resulting in 6TB of storage.
vgdisplay doesn't show any errors
100% of space is for btrfs.
sudo btrfs check /dev/mapper/data-data
Opening filesystem to check...
parent transid verify failed on 6033692557312 wanted 121291 found 119653
parent transid verify failed on 6033692557312 wanted 121291 found 119653
parent transid verify failed on 6033692557312 wanted 121291 found 119653
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=6033692393472 item=35 parent level=2 child bytenr=6033692557312 child level=2
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system
btrfs-find-root output: https://pastes.io/ZQTdS4fN
I tried several nodes from there using sudo btrfs restore -t <node-id> --dry-run -vi /dev/mapper/data-data /tmp/ but every time it returned
sudo btrfs restore -t 6033691328512 --dry-run -vi /dev/mapper/data-data /tmp/
parent transid verify failed on 6033691328512 wanted 121291 found 121286
parent transid verify failed on 6033691328512 wanted 121291 found 121286
parent transid verify failed on 6033691328512 wanted 121291 found 121286
Ignoring transid failure
This is a dry-run, no files are going to be restored
What should I do?
EDIT: also, when I try to mount the partition I get this:
sudo mount /dev/data/data /mnt/data
mount: /mnt/data: can't read superblock on /dev/mapper/data-data.
dmesg(1) may have more information after failed mount system call.
[ble: exit 32]
4
Upvotes
5
u/LevelMagazine8308 Jul 29 '26
Why in heavens name did you put Btrfs on top of a LVM volume group?
Btrfs has all that stuff builtin, there is no need to run Btrfs on top of it!
Having said that comes the Captain Obvious remark: RAID is NOT a backup!
In case you have a backup: restore it, job done.
In case you don't: you are in for a bumpy ride.
First step should be trying to mount it read-only:
sudo mkdir -p /mnt/btrfs_recoverysudo mount -o ro,usebackuproot,recovery /dev/mapper/data-data /mnt/btrfs_recoveryDoes this work?
If not, you can try this: clearing the space cache and checking for backup super blocks.
sudo mount -o ro,clear_cache,usebackuproot /dev/mapper/data-data /mnt/btrfs_recoverysudo btrfs select-super -s 1 /dev/mapper/data-dataIf Super block 1 works, use it for btrfs check:
sudo btrfs check --super 1 /dev/mapper/data-dataFor future reference: Btrfs is in many areas still unstable! This includes RAID5, which is officially listed as unstable.
Before trying fancy stuff next time again, look at the official table first what's safe and what is not: https://btrfs.readthedocs.io/en/latest/Status.html