Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTRFS corrupt leaf / open_ctree failed #963

Open
SuperManni72 opened this issue Mar 4, 2025 · 0 comments
Open

BTRFS corrupt leaf / open_ctree failed #963

SuperManni72 opened this issue Mar 4, 2025 · 0 comments

Comments

@SuperManni72
Copy link

SuperManni72 commented Mar 4, 2025

Hello,

since I have updated from Ubuntu 22.02.1 (Kernel 5.15, btrfs-progs 5.16.2) to Ubuntu 24.04. Now, with Kernel 6.8 and btrfs-progs 6.6.3-1 (and also with Kernel 6.11), I cannot mount my BTRFS disks any more.

dmesg gives me:

[Sun Feb 23 15:08:11 2025] BTRFS info (device dm-5): first mount of filesystem d560d735-e812-49a7-bcc2-d883cbeae2f4
[Sun Feb 23 15:08:11 2025] BTRFS info (device dm-5): using crc32c (crc32c-intel) checksum algorithm
[Sun Feb 23 15:08:11 2025] BTRFS info (device dm-5): disk space caching is enabled
[Sun Feb 23 15:08:12 2025] BTRFS critical (device dm-5): corrupt leaf: block=20387303407616 slot=33 extent bytenr=9103199440896 len=8238972779538548086 invalid extent data backref objectid value 13163
[Sun Feb 23 15:08:12 2025] BTRFS error (device dm-5): read time tree block corruption detected on logical 20387303407616 mirror 1
[Sun Feb 23 15:08:12 2025] BTRFS critical (device dm-5): corrupt leaf: block=20387303407616 slot=33 extent bytenr=9103199440896 len=8238972779538548086 invalid extent data backref objectid value 13163
[Sun Feb 23 15:08:12 2025] BTRFS error (device dm-5): read time tree block corruption detected on logical 20387303407616 mirror 2
[Sun Feb 23 15:08:12 2025] BTRFS error (device dm-5): failed to read block groups: -5
[Sun Feb 23 15:08:12 2025] BTRFS error (device dm-5): open_ctree failed

The following checks have been done:

1. btrfsck --readonly /dev/mapper/data1_crypt

Opening filesystem to check...
Checking filesystem on /dev/mapper/data1_crypt
UUID: d560d735-e812-49a7-bcc2-d883cbeae2f4
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 5883597525113 bytes used, no error found
total csum bytes: 5729361204
total tree bytes: 15929737216
total fs tree bytes: 9227829248
total extent tree bytes: 635011072
btree space waste bytes: 1907771393
file data blocks allocated: 57498707316736
 referenced 46500400185344

2. btrfs-find-root /dev/mapper/data1_crypt

Superblock thinks the generation is 294543
Superblock thinks the level is 1
Found tree root at 19305371582464 gen 294543 level 1
Well block 19305203253248(gen: 294542 level: 1) seems good, but generation/level doesn't match, want gen: 294543 level: 1
Well block 19305194897408(gen: 294541 level: 1) seems good, but generation/level doesn't match, want gen: 294543 level: 1
Well block 19305183739904(gen: 294540 level: 0) seems good, but generation/level doesn't match, want gen: 294543 level: 1
Well block 19305371500544(gen: 294538 level: 0) seems good, but generation/level doesn't match, want gen: 294543 level: 1
Well block 19305367502848(gen: 294538 level: 0) seems good, but generation/level doesn't match, want gen: 294543 level: 1

3. btrfs rescue super-recover -v /dev/mapper/data1_crypt

All Devices:
        Device: id = 2, name = /dev/mapper/data2_crypt
        Device: id = 1, name = /dev/mapper/data1_crypt
Before Recovering:
        [All good supers]:
                device name = /dev/mapper/data2_crypt
                superblock bytenr = 65536
                device name = /dev/mapper/data2_crypt
                superblock bytenr = 67108864
                device name = /dev/mapper/data2_crypt
                superblock bytenr = 274877906944
                device name = /dev/mapper/data1_crypt
                superblock bytenr = 65536
                device name = /dev/mapper/data1_crypt
                superblock bytenr = 67108864
                device name = /dev/mapper/data1_crypt
                superblock bytenr = 274877906944
        [All bad supers]:

All supers are valid, no need to recover

4. smartctl -a

--> No errors, no problems

5. btrfs scrub is done monthly:

sudo btrfs device stats /dev/mapper/data1_crypt
[/dev/mapper/data1_crypt].write_io_errs    0
[/dev/mapper/data1_crypt].read_io_errs     0
[/dev/mapper/data1_crypt].flush_io_errs    0
[/dev/mapper/data1_crypt].corruption_errs  0
[/dev/mapper/data1_crypt].generation_errs  0

What I have tried until now (with a clean boot from Ubuntu 22.04 Live-ISO):

6. Several mount tries (without sucess on Kernel 6.8/6.11):

mount -o recovery /dev/mapper/data1_crypt /media/ddd

mount -vs -t btrfs  -o ro,recovery,errors=continue /dev/mapper/data1_crypt /media/ddd

mount -t btrfs -o degraded,noatime,nodiratime,clear_cache /dev/mapper/data1-crypt /mnt/Daten

7. btrfs rescue zero-log /dev/mapper/data1-crypt

8. btrfs rescue clear-ino-cache /dev/mapper/data1-crypt

Unable to find block group for 0
ERROR: failed to clear ino cache: No space left on device

9. btrfs rescue clear-space-cache v1 /dev/mapper/data1-crypt

Unable to find block group for 0
ERROR: failed to clear free space cache
extent buffer leak: start 20449393967104 len 16384

10. btrfs inspect-internal tree-stats /dev/mapper/data1-crypt

warning, device 2 is missing
Calculating size of root tree
Total size: 2.28MiB
Inline data: 0.00B
Total seeks: 140
Forward seeks: 70
Backward seeks: 70
Avg seek len: 2.09TiB
Seek histogram
16384 - 185712640: 21 ###
290275328 - 50034622464: 21 ###
61473767424 - 490582196224: 21 ###
490944790528 - 932145905664: 21 ###
992462012416 - 1556186071040: 21 ###
1556985511936 - 10512543825920: 21 ###
10512621191168 - 12069176721408: 8 #
Total clusters: 4
Avg cluster size: 36.00KiB
Min cluster size: 32.00KiB
Max cluster size: 48.00KiB
Total disk spread: 11.00TiB
Total read time: 0 s 29 us
Levels: 2
Total nodes: 146
On level 0: 145
On level 1: 1 (avg fanout 145)
Calculating size of extent tree
Segmentation fault

dmesg
[Tue Mar 4 08:50:46 2025] btrfs[7804]: segfault at 0 ip 0000564b44894e65 sp 00007ffe6b099710 error 4 in btrfs[564b4482b000+71000]
[Tue Mar 4 08:50:46 2025] Code: 8d 74 24 30 48 8d ac 24 98 00 00 00 49 89 c4 4c 89 f7 e8 43 a5 f9 ff 31 c0 b9 30 00 00 00 48 89 ef f3 ab 31 f6 48 8d 7c 24 10 <49> 8b 04 24 48 c7 84 24 e8 00 00 00 ff ff ff ff 0f b6 98 dc 00 00

Now, I do not know what I can do else... and hope, someone can help me.

And nevertheless it's strange to me, that I can mount the disk with Kernel 5.15 and no error will be displayed…

Thank you & Best regards,
Markus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant