All of lore.kernel.org
 help / color / mirror / Atom feed
* Can't mount btrfs: corrupt leaf, slot offset bad
@ 2015-10-13 23:25 EJ Parker
  2015-10-14  9:15 ` Hugo Mills
  0 siblings, 1 reply; 2+ messages in thread
From: EJ Parker @ 2015-10-13 23:25 UTC (permalink / raw)
  To: linux-btrfs

I rebooted my server last night and discovered that my btrfs
filesystem (3 disk raid1) would not mount anymore. After doing some
research and getting nowhere I went to IRC and user darkling asked me
a few questions and asked for output of btrfs-debug-tree and
ultimately sent me here saying I should include a handful of things:

Before I go further, let's get required info out of the way:

uname -a:
        Linux archhost1 4.2.3-1-ARCH #1 SMP PREEMPT Sat Oct 3 18:52:50
CEST 2015 x86_64 GNU/Linux
btrfs --version:
        btrfs-progs v4.2.1
output from "btrfs fi show":
    Label: none  uuid: 5470630f-39f4-4d39-90a2-277d7991722a
        Total devices 3 FS bytes used 3.10TiB
        devid    1 size 3.64TiB used 2.12TiB path /dev/sdd
        devid    2 size 3.64TiB used 2.12TiB path /dev/sde
        devid    3 size 3.64TiB used 2.12TiB path /dev/sdc

First, I am able to mount with -o ro,recovery, but not with just -o
recovery. When I attempt to mount w/o ro, I get this in dmesg:
[44478.800613] BTRFS critical (device sde): corrupt leaf, slot offset
bad: block=5674754899968,root=1, slot=147
[44478.802489] BTRFS critical (device sde): corrupt leaf, slot offset
bad: block=5674754899968,root=1, slot=147
[44478.804072] BTRFS error (device sde): Error removing orphan entry,
stopping orphan cleanup
[44478.805856] BTRFS error (device sde): could not do orphan cleanup -22
[44482.635498] BTRFS: open_ctree failed

Running "btrfs-debug-tree -b 5674754899968 /dev/sde" gave me this:
leaf 5674754899968 items 207 free space 30 generation 884595 owner 5
fs uuid 5470630f-39f4-4d39-90a2-277d7991722a
chunk uuid c269615e-7397-41bc-95d0-dfdb2a696b23
[...]
        item 145 key (273094 EXTENT_DATA 364924928) itemoff 8545 itemsize 53
                extent data disk byte 8658465382400 nr 4096
                extent data offset 0 nr 4096 ram 4096
                extent compression 0
        item 146 key (273094 EXTENT_DATA 364929024) itemoff 8492 itemsize 53
                extent data disk byte 8658465378304 nr 4096
                extent data offset 0 nr 4096 ram 4096
                extent compression 0
        item 147 key (273094 EXTENT_DATA 364933120) itemoff 8439 itemsize 53
                extent data disk byte 8677950173184 nr 24576
                extent data offset 0 nr 20480 ram 24576
                extent compression 0
        item 148 key (273094 EXTENT_DATA 364953600) itemoff 8333 itemsize 53
                extent data disk byte 8677990363136 nr 20480
                extent data offset 0 nr 16384 ram 20480
                extent compression 0
        item 149 key (273094 EXTENT_DATA 364957696) itemoff 8386 itemsize 53
                extent data disk byte 0 nr 0
                extent data offset 0 nr 18446744073709514752 ram
18446744073709514752
                extent compression 0
        item 150 key (273094 EXTENT_DATA 364969984) itemoff 8280 itemsize 53
                extent data disk byte 8678063341568 nr 20480
                extent data offset 0 nr 16384 ram 20480
                extent compression 0
        item 151 key (273094 EXTENT_DATA 365002752) itemoff 8227 itemsize 53
                extent data disk byte 8678025232384 nr 36864
                extent data offset 0 nr 32768 ram 36864
                extent compression 0
        item 152 key (273094 EXTENT_DATA 365019136) itemoff 8174 itemsize 53
                extent data disk byte 8678112104448 nr 36864
                extent data offset 0 nr 32768 ram 36864
                extent compression 0
        item 153 key (273094 EXTENT_DATA 365051904) itemoff 8121 itemsize 53
                extent data disk byte 8678052835328 nr 53248
                extent data offset 0 nr 49152 ram 53248
                extent compression 0
        item 154 key (273094 EXTENT_DATA 365101056) itemoff 8068 itemsize 53
                extent data disk byte 8678090510336 nr 20480
                extent data offset 0 nr 16384 ram 20480
                extent compression 0
        item 155 key (273094 EXTENT_DATA 365117440) itemoff 8015 itemsize 53
                extent data disk byte 8678117130240 nr 20480
                extent data offset 0 nr 16384 ram 20480
                extent compression 0
[...]


Output from "btrfs check --readonly /dev/sde":
Checking filesystem on /dev/sde
UUID: 5470630f-39f4-4d39-90a2-277d7991722a
checking extents
incorrect offsets 8439 8386
bad block 5674754899968
Errors found in extent allocation tree or chunk allocation
checking free space cache
checking fs roots

Output from (failed) "btrfs check --repair /dev/sdc" (which I tried
prior to seeking help):
enabling repair mode
Checking filesystem on /dev/sdc
UUID: 5470630f-39f4-4d39-90a2-277d7991722a
checking extents
incorrect offsets 8439 8386
shifting item nr 148 by bytes in block 5674754899968
items overlap, can't fix
cmds-check.c:4059: fix_item_offset: Assertion `ret` failed.


darklink also mentioned that btrfs-zero-log might help too, but that I
should get confirmation from one of the devs on that.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Can't mount btrfs: corrupt leaf, slot offset bad
  2015-10-13 23:25 Can't mount btrfs: corrupt leaf, slot offset bad EJ Parker
@ 2015-10-14  9:15 ` Hugo Mills
  0 siblings, 0 replies; 2+ messages in thread
From: Hugo Mills @ 2015-10-14  9:15 UTC (permalink / raw)
  To: EJ Parker; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

On Tue, Oct 13, 2015 at 06:25:54PM -0500, EJ Parker wrote:
> I rebooted my server last night and discovered that my btrfs
> filesystem (3 disk raid1) would not mount anymore. After doing some
> research and getting nowhere I went to IRC and user darkling asked me
> a few questions and asked for output of btrfs-debug-tree and
> ultimately sent me here saying I should include a handful of things:
> 
> Before I go further, let's get required info out of the way:
> 
> uname -a:
>         Linux archhost1 4.2.3-1-ARCH #1 SMP PREEMPT Sat Oct 3 18:52:50
> CEST 2015 x86_64 GNU/Linux
> btrfs --version:
>         btrfs-progs v4.2.1
> output from "btrfs fi show":
>     Label: none  uuid: 5470630f-39f4-4d39-90a2-277d7991722a
>         Total devices 3 FS bytes used 3.10TiB
>         devid    1 size 3.64TiB used 2.12TiB path /dev/sdd
>         devid    2 size 3.64TiB used 2.12TiB path /dev/sde
>         devid    3 size 3.64TiB used 2.12TiB path /dev/sdc
> 
> First, I am able to mount with -o ro,recovery, but not with just -o
> recovery. When I attempt to mount w/o ro, I get this in dmesg:
[snip]
> darklink also mentioned that btrfs-zero-log might help too, but that I
> should get confirmation from one of the devs on that.

   I suggested the zero-log might work because the FS is mountable
with -o ro, but not without, which suggests a corrupt log. However,
it's not obvious to me what tree the corruption is in, and whether
zeroing the log might actually hurt the recovery process.

   Hugo.

-- 
Hugo Mills             | There's an infinite number of monkeys outside who
hugo@... carfax.org.uk | want to talk to us about this new script for Hamlet
http://carfax.org.uk/  | they've worked out!
PGP: E2AB1DE4          |                                           Arthur Dent

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-14  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 23:25 Can't mount btrfs: corrupt leaf, slot offset bad EJ Parker
2015-10-14  9:15 ` Hugo Mills

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.