Skip to contentSkip to conversation

errors reported by btrfs-check

DISCUSSION Jürgen Herrmann 3 participants 8 messages Oct 11, 2018 – Oct 12, 2018 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi!

I just did a btrfs check on my laptop's btrfs filesystem while i was on the usb stick rescue system.

the following errors where reported:

root@mint:/home/mint# btrfs check /dev/mapper/sda3crypt
Checking filesystem on /dev/mapper/sda3crypt
UUID: a914c141-72bf-448b-847f-d64ee82d8b7b
checking extents
checking free space cache
checking fs roots
root 258 inode 3082368 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082370 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082371 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082373 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082414 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082415 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 258 inode 3082421 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1387 inode 3082368 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082370 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082371 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082372 errors 100, file extent discount
Found file extent holes:
	start: 8192, len: 4096
	start: 16384, len: 4096
	start: 24576, len: 4096
	start: 32768, len: 4096
	start: 40960, len: 4096
	start: 49152, len: 20480
	start: 73728, len: 4096
	start: 81920, len: 4096
	start: 90112, len: 8192
root 1387 inode 3082373 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082374 errors 100, file extent discount
Found file extent holes:
	start: 8192, len: 4096
	start: 16384, len: 20480
	start: 40960, len: 12288
	start: 57344, len: 4096
	start: 65536, len: 8192
root 1387 inode 3082380 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 233472
root 1387 inode 3082386 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1387 inode 3082398 errors 100, file extent discount
Found file extent holes:
	start: 20480, len: 16384
root 1387 inode 3082414 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082415 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1387 inode 3082421 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1391 inode 3082368 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082370 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082371 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082373 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082386 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1391 inode 3082414 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082415 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1391 inode 3082421 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1394 inode 3082368 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082370 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082371 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082373 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082386 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
root 1394 inode 3082414 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082415 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 8192
root 1394 inode 3082421 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 4096
ERROR: errors found in fs roots
found 469458231296 bytes used, error(s) found
total csum bytes: 451180560
total tree bytes: 4558831616
total fs tree bytes: 3802955776
total extent tree bytes: 245055488
btree space waste bytes: 842802897
file data blocks allocated: 9656815640576
 referenced 929225080832

Scrub completes ok though.

I'm prepared to wipe the fs if needed, more than one backup is ready :)

I wanted to ask here first if I should attempt a repair.

Best regards,
Jürgen

Signature · 4 lines
Jürgen Herrmann
https://t-5.eu
ALbertstraße 2
94327 Bogen
#3 lore raw
In reply to Jürgen Herrmann
Quoted 139 lines · Jürgen Herrmann

Hi!

I just did a btrfs check on my laptop's btrfs filesystem while i was on the usb stick rescue system.

the following errors where reported:

root@mint:/home/mint# btrfs check /dev/mapper/sda3crypt
Checking filesystem on /dev/mapper/sda3crypt
UUID: a914c141-72bf-448b-847f-d64ee82d8b7b
checking extents
checking free space cache
checking fs roots
root 258 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1387 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082372 errors 100, file extent discount
Found file extent holes:
    start: 8192, len: 4096
    start: 16384, len: 4096
    start: 24576, len: 4096
    start: 32768, len: 4096
    start: 40960, len: 4096
    start: 49152, len: 20480
    start: 73728, len: 4096
    start: 81920, len: 4096
    start: 90112, len: 8192
root 1387 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082374 errors 100, file extent discount
Found file extent holes:
    start: 8192, len: 4096
    start: 16384, len: 20480
    start: 40960, len: 12288
    start: 57344, len: 4096
    start: 65536, len: 8192
root 1387 inode 3082380 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 233472
root 1387 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1387 inode 3082398 errors 100, file extent discount
Found file extent holes:
    start: 20480, len: 16384
root 1387 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1391 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1391 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1394 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1394 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
ERROR: errors found in fs roots
found 469458231296 bytes used, error(s) found
total csum bytes: 451180560
total tree bytes: 4558831616
total fs tree bytes: 3802955776
total extent tree bytes: 245055488
btree space waste bytes: 842802897
file data blocks allocated: 9656815640576
 referenced 929225080832
Quoted 3 lines

Scrub completes ok though.

I'm prepared to wipe the fs if needed, more than one backup is ready :)

No need. File extent discount is not a big problem.

It only means btrfs lacks some hole file extent to fill the hole.

It can be "fixed" easily by enabling no_holes features:

# btrfstune -n <device>
Quoted 2 lines

I wanted to ask here first if I should attempt a repair.

And of course, btrfs check --repair should be able to fix it.

Thanks,
Qu

Quoted 3 lines

Best regards,
Jürgen

#4 lore raw

Am 12.10.2018 01:56, schrieb Qu Wenruo:

Quoted 153 lines · Jürgen Herrmann
Quoted 139 lines

Hi!

I just did a btrfs check on my laptop's btrfs filesystem while i was on the usb stick rescue system.

the following errors where reported:

root@mint:/home/mint# btrfs check /dev/mapper/sda3crypt
Checking filesystem on /dev/mapper/sda3crypt
UUID: a914c141-72bf-448b-847f-d64ee82d8b7b
checking extents
checking free space cache
checking fs roots
root 258 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 258 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1387 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082372 errors 100, file extent discount
Found file extent holes:
    start: 8192, len: 4096
    start: 16384, len: 4096
    start: 24576, len: 4096
    start: 32768, len: 4096
    start: 40960, len: 4096
    start: 49152, len: 20480
    start: 73728, len: 4096
    start: 81920, len: 4096
    start: 90112, len: 8192
root 1387 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082374 errors 100, file extent discount
Found file extent holes:
    start: 8192, len: 4096
    start: 16384, len: 20480
    start: 40960, len: 12288
    start: 57344, len: 4096
    start: 65536, len: 8192
root 1387 inode 3082380 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 233472
root 1387 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1387 inode 3082398 errors 100, file extent discount
Found file extent holes:
    start: 20480, len: 16384
root 1387 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1387 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1391 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1391 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1391 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1394 inode 3082368 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082370 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082371 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082373 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082386 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
root 1394 inode 3082414 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082415 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 8192
root 1394 inode 3082421 errors 100, file extent discount
Found file extent holes:
    start: 0, len: 4096
ERROR: errors found in fs roots
found 469458231296 bytes used, error(s) found
total csum bytes: 451180560
total tree bytes: 4558831616
total fs tree bytes: 3802955776
total extent tree bytes: 245055488
btree space waste bytes: 842802897
file data blocks allocated: 9656815640576
 referenced 929225080832
Quoted 3 lines

Scrub completes ok though.

I'm prepared to wipe the fs if needed, more than one backup is ready :)

No need. File extent discount is not a big problem.

It only means btrfs lacks some hole file extent to fill the hole.

It can be "fixed" easily by enabling no_holes features:

# btrfstune -n <device>
Quoted 1 line
Quoted 10 lines
Quoted 1 line

I wanted to ask here first if I should attempt a repair.

And of course, btrfs check --repair should be able to fix it.

Thanks,
Qu

Quoted 3 lines

Best regards,
Jürgen

Hi there!

I ran btrfs check --repair on the filesystem. I dont' have this log anymore, as it was then sitting on the repaired fs), which is now dead. after repairing it I could still mount the fs.

as my btrfs send problem still persists (another thread), I decided to run check again... this time i saved the logs to a different partition as it was more convenient at that time. here's the output:

Checking filesystem on /dev/mapper/sda3c
UUID: a914c141-72bf-448b-847f-d64ee82d8b7b
[1/7] checking root items
Fixed 0 roots.
[2/7] checking extents
No device size related problem found
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated [4/7] checking fs roots
root 1387 inode 3082380 errors 100, file extent discount Found file extent holes:

	start: 0, len: 233472

ERROR: errors found in fs roots
found 470636822528 bytes used, error(s) found
total csum bytes: 452176524
total tree bytes: 4579753984
total fs tree bytes: 3822665728
total extent tree bytes: 245301248
btree space waste bytes: 847442809
file data blocks allocated: 9670623588352
referenced 932405829632

I did a repair once again but the error did not go away.

after rebooting the fs is no longer mountable:

mint@mint:/tmp$ sudo /tmp/btrfs check /dev/mapper/sda3c
Opening filesystem to check...
parent transid verify failed on 166475366400 wanted 127054 found 127060
parent transid verify failed on 166475366400 wanted 127054 found 127060
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=166456229888 item=22 parent level=2 child level=0
ERROR: cannot open file system

If anyone wants me to help debugging this issue you will have to respond fast, because i need my laptop back in working condition and will soon nuke the fs. after all I will try one more time with a freshly formatted btrfs partition. if i still get these kinds of errors i will have to move back to the tried and true xfs :/

best regards,
Jürgen

Signature · 4 lines
Jürgen Herrmann
https://t-5.eu
ALbertstraße 2
94327 Bogen
#5 lore raw

[snip]

Quoted 37 lines

Hi there!

I ran btrfs check --repair on the filesystem. I dont' have this log anymore,
as it was then sitting on the repaired fs), which is now dead. after repairing it I could still mount the fs.

as my btrfs send problem still persists (another thread), I decided to run check
again... this time i saved the logs to a different partition as it was more convenient at that time. here's the output:

Checking filesystem on /dev/mapper/sda3c
UUID: a914c141-72bf-448b-847f-d64ee82d8b7b
[1/7] checking root items
Fixed 0 roots.
[2/7] checking extents
No device size related problem found
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated [4/7] checking fs roots
root 1387 inode 3082380 errors 100, file extent discount Found file extent holes:
    start: 0, len: 233472
ERROR: errors found in fs roots
found 470636822528 bytes used, error(s) found
total csum bytes: 452176524
total tree bytes: 4579753984
total fs tree bytes: 3822665728
total extent tree bytes: 245301248
btree space waste bytes: 847442809
file data blocks allocated: 9670623588352
 referenced 932405829632

I did a repair once again but the error did not go away.

Quoted 8 lines

after rebooting the fs is no longer mountable:

mint@mint:/tmp$ sudo /tmp/btrfs check /dev/mapper/sda3c
Opening filesystem to check...
parent transid verify failed on 166475366400 wanted 127054 found 127060
parent transid verify failed on 166475366400 wanted 127054 found 127060
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=166456229888 item=22 parent
level=2 child level=0

Please run the following command:

# btrfs ins dump-tree --follow -b 166456229888

It could be caused by the fact that btrfs-progs --repair doesn't handle log tree well.

If that's the case, "btrfs rescue zero-log" should help.

But anyway, feel free to re-create the fs if zero-log doesn't help.

Thanks,
Qu

Quoted 11 lines

ERROR: cannot open file system

If anyone wants me to help debugging this issue you will have to respond fast, because i need my laptop back in working condition and will soon nuke the fs. after all I will try one more time with a freshly formatted btrfs partition. if i still get these kinds of errors i will have to move back to
the tried and true xfs :/

best regards,
Jürgen

#6 lore raw

Am 12.10.2018 10:19, schrieb Qu Wenruo:

[snip]

Quoted 7 lines

Please run the following command:

# btrfs ins dump-tree --follow -b 166456229888

It could be caused by the fact that btrfs-progs --repair doesn't handle log tree well.

Quoted 6 lines

If that's the case, "btrfs rescue zero-log" should help.

But anyway, feel free to re-create the fs if zero-log doesn't help.

Thanks,
Qu

First of all, thanks for your help!

Did that:

root@mint:/home/mint# /tmp/btrfs ins dump-tree --follow -b 166456229888 /dev/mapper/sda3c  > /tmp/btrfs-ins.txt
parent transid verify failed on 166475366400 wanted 127054 found 127060
Ignoring transid failure
WARNING: eb corrupted: parent bytenr 166456229888 slot 22 level 2 child bytenr 166475366400 level has 0 expect 1, skipping the slot

The created btrfs-ins.txt is ~300MB in size, so i did not attach that here. do you need id? then I can upload it to my owncloud and post a link here.

after that i tried to zero the log:
parent transid verify failed on 166475366400 wanted 127054 found 127060 parent transid verify failed on 166475366400 wanted 127054 found 127060 Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=166456229888 item=22 parent level=2 child level=0
ERROR: could not open ctree

mounting is still not possible:

[ 2726.355134] BTRFS info (device dm-0): disk space caching is enabled
[ 2726.355138] BTRFS info (device dm-0): has skinny extents
[ 2726.395638] BTRFS error (device dm-0): parent transid verify failed on 166475366400 wanted 127054 found 127060
[ 2726.395647] BTRFS error (device dm-0): failed to read block groups: -5
[ 2726.451907] BTRFS error (device dm-0): open_ctree failed

Anything left to try?

Best regards,
Jürgen

Signature · 4 lines
Jürgen Herrmann
https://t-5.eu
ALbertstraße 2
94327 Bogen
#7 lore raw
Quoted 41 lines · Jürgen Herrmann

Am 12.10.2018 10:19, schrieb Qu Wenruo:

[snip]

Quoted 7 lines

Please run the following command:

# btrfs ins dump-tree --follow -b 166456229888

It could be caused by the fact that btrfs-progs --repair doesn't handle log tree well.

Quoted 6 lines

If that's the case, "btrfs rescue zero-log" should help.

But anyway, feel free to re-create the fs if zero-log doesn't help.

Thanks,
Qu

First of all, thanks for your help!

Did that:

root@mint:/home/mint# /tmp/btrfs ins dump-tree --follow -b 166456229888
/dev/mapper/sda3c  > /tmp/btrfs-ins.txt
parent transid verify failed on 166475366400 wanted 127054 found 127060
Ignoring transid failure
WARNING: eb corrupted: parent bytenr 166456229888 slot 22 level 2 child
bytenr 166475366400 level has 0 expect 1, skipping the slot

The created btrfs-ins.txt is ~300MB in size, so i did not attach that here. do you need id? then I can upload it to my owncloud and post a link here.

after that i tried to zero the log:
parent transid verify failed on 166475366400 wanted 127054 found 127060 parent transid verify failed on 166475366400 wanted 127054 found 127060 Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=166456229888 item=22 parent level=2 child level=0
ERROR: could not open ctree

Quoted 6 lines

mounting is still not possible:

[ 2726.355134] BTRFS info (device dm-0): disk space caching is enabled
[ 2726.355138] BTRFS info (device dm-0): has skinny extents
[ 2726.395638] BTRFS error (device dm-0): parent transid verify failed
on 166475366400 wanted 127054 found 127060
[ 2726.395647] BTRFS error (device dm-0): failed to read block groups: -5

This means the extent tree is corrupted.

This is not a good thing at all.

Please go ahead and recreate the fs.

I'm not sure how is --repair contribute to this bug in current stage. The biggest problem is, after your first --repair attempt, it doesn't report any extent tree corruption.

Quoted 3 lines
[ 2726.451907] BTRFS error (device dm-0): open_ctree failed

Anything left to try?

No, please go ahead to do what you need to.

Thanks,
Qu

Quoted 3 lines

Best regards,
Jürgen