All of lore.kernel.org
 help / color / mirror / Atom feed
* Errors found in extent allocation tree or chunk allocation
@ 2024-12-04  0:02 Nicolas Gnyra
  2024-12-04  2:50 ` Qu Wenruo
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Gnyra @ 2024-12-04  0:02 UTC (permalink / raw)
  To: linux-btrfs

Hi all,

I seem to have messed up my btrfs filesystem after adding a new (3rd) 
drive and running `btrfs balance start -dconvert=raid5 -mconvert=raid1c3 
/path/to/mount`. It ran for a while and I thought it had finished 
successfully but after a reboot it's stuck mounting as read-only. I 
seemingly am able to mount it as read/write if I add `-o skip_balance` 
but if I try to write to it, it locks up again. I managed to run a scrub 
in this state but it found no errors.

Kernel logs: https://pastebin.com/Cs06sNnr (drives sdb, sdc, and sdd, 
UUID dfa2779b-b7d1-4658-89f7-dabe494e67c8)
`btrfs check`: https://pastebin.com/7SJZS3Yv
`btrfs check --repair` (ran after a discussion in Libera Chat, failed): 
https://pastebin.com/BGLSx6GM

I'm currently running btrfs-progs v6.12 but the balance was originally 
run on v5.10.1. Is there any way to recover from this or should I just 
nuke the filesystem and restart from scratch? There's nothing super 
important on there, it's just going to be annoying to restore from a 
backup, and I thought it'd be interesting to try to figure out what 
happened here.

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread
* errors found in extent allocation tree or chunk allocation
@ 2023-01-10 12:49 Frankie Fisher
  2023-01-12 22:59 ` Frankie Fisher
  0 siblings, 1 reply; 14+ messages in thread
From: Frankie Fisher @ 2023-01-10 12:49 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I upgraded a box's kernel from 5.4 to 5.15 then restarted it. The box had been up for 2 months before the restart and after the restart the btrfs filesystem wouldn't mount. I suppose there are two possibilities - the issue occurred during the 2 months of uptime or as a consequence of starting up with the newer kernel.

uname -a:

Linux basie 5.4.0-136-generic #153-Ubuntu SMP Thu Nov 24 15:56:58 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux basie 5.15.0-57-generic #63~20.04.1-Ubuntu SMP Wed Nov 30 13:40:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 

I first restarted with the older kernel 5.4 and the problem recurred. dmesg output (filtered for btrfs/BTRFS) is similar with both kernels:



[    4.607811] Btrfs loaded, crc32c=crc32c-intel, zoned=yes, fsverity=yes
[   22.257868] BTRFS: device fsid 0f4a1bba-fbd1-4007-88f8-5c288a8eb161 devid 11 transid 4797718 /dev/sdh2 scanned by btrfs (561)
[   22.257977] BTRFS: device fsid 0f4a1bba-fbd1-4007-88f8-5c288a8eb161 devid 8 transid 4797718 /dev/sdg2 scanned by btrfs (561)
[   22.258313] BTRFS: device fsid 0f4a1bba-fbd1-4007-88f8-5c288a8eb161 devid 10 transid 4797718 /dev/sdf2 scanned by btrfs (561)
[   22.258420] BTRFS: device fsid 0f4a1bba-fbd1-4007-88f8-5c288a8eb161 devid 7 transid 4797718 /dev/sde2 scanned by btrfs (561)
[   22.258531] BTRFS: device fsid 0f4a1bba-fbd1-4007-88f8-5c288a8eb161 devid 9 transid 4797718 /dev/sdd2 scanned by btrfs (561)
[   29.581350] BTRFS info (device sde2): disk space caching is enabled
[   31.414167] BTRFS info (device sde2): bdev /dev/sde2 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
[   33.735212] BTRFS critical (device sde2): corrupt leaf: block=30874802077696 slot=176 extent bytenr=21866556121088 len=4096 previous extent [21866556112896 168 4503599627378688] overlaps current extent [21866556121088 168 4096]
[   33.735234] BTRFS error (device sde2): block=30874802077696 read time tree block corruption detected
[   33.751471] BTRFS critical (device sde2): corrupt leaf: block=30874802077696 slot=176 extent bytenr=21866556121088 len=4096 previous extent [21866556112896 168 4503599627378688] overlaps current extent [21866556121088 168 4096]
[   33.751484] BTRFS error (device sde2): block=30874802077696 read time tree block corruption detected
[   33.751517] BTRFS error (device sde2): failed to read block groups: -5
[   33.757126] BTRFS error (device sde2): open_ctree failed

I ran btrfs check with btrfs-progs v5.4.1

Checking filesystem on /dev/sde2
UUID: 0f4a1bba-fbd1-4007-88f8-5c288a8eb161
[1/7] checking root items

[2/7] checking extents
ref mismatch on [21866556112896 4503599627378688] extent item 0, found 1
backref bytes do not match extent backref, bytenr=21866556112896, ref bytes=4503599627378688, backref bytes=8192
backpointer mismatch on [21866556112896 4503599627378688]
extent item 22704514924544 has multiple extent items
ref mismatch on [28106103517184 8192] extent item 4503599627370497, found 1
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space cache
there is no free space entry for 4525466183491584-21866556121088
cache appears valid but isn't 21865483468800
[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 4511516231163904 bytes used, error(s) found
total csum bytes: 7142228136
total tree bytes: 11304239104
total fs tree bytes: 3378511872
total extent tree bytes: 386826240
btree space waste bytes: 930753844
file data blocks allocated: 28547414216704
 referenced 7990763888640


I also installed btrfs-progs v6.1.2 and the outputi was similar, other than section [3/7]:

[3/7] checking free space cache
There are still entries left in the space cache
cache appears valid but isn't 21866557210624
There are still entries left in the space cache
cache appears valid but isn't 21867630952448
.... (similar lines removed)



Any suggestions to recover this filesystem are gratefully received!

Cheers,

Frankie Fisher

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

end of thread, other threads:[~2025-03-15 16:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04  0:02 Errors found in extent allocation tree or chunk allocation Nicolas Gnyra
2024-12-04  2:50 ` Qu Wenruo
2024-12-04  3:58   ` Nicolas Gnyra
2024-12-04  4:23     ` Qu Wenruo
2024-12-04  4:43       ` Nicolas Gnyra
2024-12-04 13:38         ` Nicolas Gnyra
2025-01-29 19:33   ` Nicolas Gnyra
2025-01-29 23:35     ` Qu Wenruo
2025-01-30  3:49       ` Nicolas Gnyra
2025-01-30  4:19         ` Qu Wenruo
2025-01-30  5:21           ` Nicolas Gnyra
2025-03-15 16:52     ` Nicolas Gnyra
  -- strict thread matches above, loose matches on Subject: below --
2023-01-10 12:49 errors " Frankie Fisher
2023-01-12 22:59 ` Frankie Fisher

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.