Bug 64411 - Partition broken, btrfsck segfaults or asserts
Summary: Partition broken, btrfsck segfaults or asserts
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-04 22:48 UTC by Dennis Schridde
Modified: 2013-11-05 12:48 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.11.6
Tree: Mainline
Regression: No


Attachments
btrfsck --repair (131.66 KB, text/plain)
2013-11-04 22:48 UTC, Dennis Schridde
Details
btrsfck (no options, segfault) (124.77 KB, text/plain)
2013-11-04 22:49 UTC, Dennis Schridde
Details
btrfs restore -i (72.75 KB, text/x-log)
2013-11-05 12:48 UTC, Dennis Schridde
Details

Description Dennis Schridde 2013-11-04 22:48:48 UTC
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
Comment 1 Dennis Schridde 2013-11-04 22:49:27 UTC
Created attachment 113381 [details]
btrsfck (no options, segfault)
Comment 2 Dennis Schridde 2013-11-05 12:17:08 UTC
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)
Comment 3 Dennis Schridde 2013-11-05 12:36:07 UTC
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
Comment 4 Dennis Schridde 2013-11-05 12:48:35 UTC
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

Note You need to log in before you can comment on or make changes to this bug.