Created attachment 113371 [details] btrfsck --repair I have a serious problem with inaccessible data and segfaulting btrfsck for the /var partition on my computer. The reason is not entirely clear to me. The only extraordinary things happening today were an empty CMOS battery and me accidentally enabling C1E support when reconfiguring the BIOS. Afterwards the computer did not boot properly anymore (some GPU lockup thingy and the whole system locked up hard before X would start) and when I cut the power and setup the BIOS again (this time without C1E support), /var would be broken in the state I describe below. I can mount it, and dmesg says the following, which seems normal: --- device label var devid 1 transid 393536 /dev/sda7 btrfs: use lzo compression btrfs: enabling auto defrag --- When I access certain directories, however, I get a message like this one: ls: cannot access /var/log: Stale NFS file handle When I run btrfsck --repair it asserts, and when I just run btrfsck without extra options it segfaults. Sadly I do not have debug symbols installed, so the backtrace is probably useless. I attached the stdout/err output of both runs. # btrfs --version Btrfs v0.20-rc1-358-g194aa4a # uname -r 3.11.6-gentoo
Created attachment 113381 [details] btrsfck (no options, segfault)
Thanks to a hint from darkling on IRC, I tried to save the metadata and got following error message: # btrfs-image -c9 -t2 /dev/sda7 ... Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=0 Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=17294013978346844026 read block failed check_tree_block Error reading metadata block Error adding block -5 Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=0 Check tree block failed, want=30072832, have=17294013978346844026 Check tree block failed, want=30072832, have=17294013978346844026 read block failed check_tree_block Error reading metadata block Error flushing pending -5 create failed (Success)
Another suggestion was to restore the partition, but that also fails: # btrfs restore /dev/sda7 /var.backup Check tree block failed, want=30081024, have=0 Check tree block failed, want=30081024, have=0 Check tree block failed, want=30081024, have=30076928 Check tree block failed, want=30081024, have=30076928 Check tree block failed, want=30081024, have=30076928 read block failed check_tree_block Error searching -5
Created attachment 113481 [details] btrfs restore -i (In reply to Dennis Schridde from comment #3) > # btrfs restore -i /dev/sda7 /var.backup ignoring errors this time