You are not logged in.

#1 2023-10-24 11:22:08

beachcoder
Member
Registered: 2009-10-08
Posts: 130

[SOLVED] btrfs filesystem broken

TL;DR: Hardware issue, SSD was corrupt.

Hi!

My btrfs filesystem seems to be broken. It sometimes jumps to 100% occupancy even though there are 36 GB free. btrfsck gives some errors as you can see below, but everywhere I read it is advised not to use the repair function of the tool. What can I do now?

# btrfsck /dev/mapper/root 
Opening filesystem to check...
Checking filesystem on /dev/mapper/root
UUID: 78a385b5-23bc-415a-bd11-80f8558d9857
[1/7] checking root items
[2/7] checking extents
ref mismatch on [2239053824 4096] extent item 6, found 5
incorrect local backref count on 2239053824 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55f00b849550
backref disk bytenr does not match extent record, bytenr=2239053824, ref bytenr=0
backpointer mismatch on [2239053824 4096]
ref mismatch on [2938404864 4096] extent item 6, found 5
incorrect local backref count on 2938404864 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55f00c963860
backref disk bytenr does not match extent record, bytenr=2938404864, ref bytenr=0
backpointer mismatch on [2938404864 4096]
ref mismatch on [6164750336 4096] extent item 6, found 5
incorrect local backref count on 6164750336 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff55e67b0
backref disk bytenr does not match extent record, bytenr=6164750336, ref bytenr=0
backpointer mismatch on [6164750336 4096]
ref mismatch on [27558490112 4096] extent item 1, found 0
incorrect local backref count on 27558490112 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff8a03770
backref disk bytenr does not match extent record, bytenr=27558490112, ref bytenr=0
backpointer mismatch on [27558490112 4096]
owner ref check failed [27558490112 4096]
ref mismatch on [312092278784 4096] extent item 6, found 5
incorrect local backref count on 312092278784 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff142b510
backref disk bytenr does not match extent record, bytenr=312092278784, ref bytenr=0
backpointer mismatch on [312092278784 4096]
ref mismatch on [312803762176 4096] extent item 6, found 5
incorrect local backref count on 312803762176 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55f00b1554c0
backref disk bytenr does not match extent record, bytenr=312803762176, ref bytenr=0
backpointer mismatch on [312803762176 4096]
ref mismatch on [370433994752 4096] extent item 6, found 5
incorrect local backref count on 370433994752 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e8b00
backref disk bytenr does not match extent record, bytenr=370433994752, ref bytenr=0
backpointer mismatch on [370433994752 4096]
ref mismatch on [370433998848 4096] extent item 6, found 5
incorrect local backref count on 370433998848 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e8e10
backref disk bytenr does not match extent record, bytenr=370433998848, ref bytenr=0
backpointer mismatch on [370433998848 4096]
ref mismatch on [370434002944 4096] extent item 6, found 5
incorrect local backref count on 370434002944 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e9120
backref disk bytenr does not match extent record, bytenr=370434002944, ref bytenr=0
backpointer mismatch on [370434002944 4096]
ref mismatch on [370434007040 4096] extent item 6, found 5
incorrect local backref count on 370434007040 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e9430
backref disk bytenr does not match extent record, bytenr=370434007040, ref bytenr=0
backpointer mismatch on [370434007040 4096]
ref mismatch on [370434011136 4096] extent item 6, found 5
incorrect local backref count on 370434011136 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e9740
backref disk bytenr does not match extent record, bytenr=370434011136, ref bytenr=0
backpointer mismatch on [370434011136 4096]
ref mismatch on [370434015232 4096] extent item 6, found 5
incorrect local backref count on 370434015232 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e9a50
backref disk bytenr does not match extent record, bytenr=370434015232, ref bytenr=0
backpointer mismatch on [370434015232 4096]
ref mismatch on [370434019328 4096] extent item 6, found 5
incorrect local backref count on 370434019328 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72e9d60
backref disk bytenr does not match extent record, bytenr=370434019328, ref bytenr=0
backpointer mismatch on [370434019328 4096]
ref mismatch on [370434023424 4096] extent item 6, found 5
incorrect local backref count on 370434023424 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72ea070
backref disk bytenr does not match extent record, bytenr=370434023424, ref bytenr=0
backpointer mismatch on [370434023424 4096]
ref mismatch on [370434027520 4096] extent item 6, found 5
incorrect local backref count on 370434027520 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72ea380
backref disk bytenr does not match extent record, bytenr=370434027520, ref bytenr=0
backpointer mismatch on [370434027520 4096]
ref mismatch on [370434031616 4096] extent item 6, found 5
incorrect local backref count on 370434031616 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72ea690
backref disk bytenr does not match extent record, bytenr=370434031616, ref bytenr=0
backpointer mismatch on [370434031616 4096]
ref mismatch on [370434035712 4096] extent item 6, found 5
incorrect local backref count on 370434035712 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72ea9a0
backref disk bytenr does not match extent record, bytenr=370434035712, ref bytenr=0
backpointer mismatch on [370434035712 4096]
ref mismatch on [370434039808 4096] extent item 6, found 5
incorrect local backref count on 370434039808 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72eacb0
backref disk bytenr does not match extent record, bytenr=370434039808, ref bytenr=0
backpointer mismatch on [370434039808 4096]
ref mismatch on [370434043904 4096] extent item 6, found 5
incorrect local backref count on 370434043904 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72eafc0
backref disk bytenr does not match extent record, bytenr=370434043904, ref bytenr=0
backpointer mismatch on [370434043904 4096]
ref mismatch on [370434048000 4096] extent item 6, found 5
incorrect local backref count on 370434048000 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72eb2d0
backref disk bytenr does not match extent record, bytenr=370434048000, ref bytenr=0
backpointer mismatch on [370434048000 4096]
ref mismatch on [370434052096 4096] extent item 6, found 5
incorrect local backref count on 370434052096 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72eb5e0
backref disk bytenr does not match extent record, bytenr=370434052096, ref bytenr=0
backpointer mismatch on [370434052096 4096]
ref mismatch on [370434056192 4096] extent item 6, found 5
incorrect local backref count on 370434056192 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff72eb8f0
backref disk bytenr does not match extent record, bytenr=370434056192, ref bytenr=0
backpointer mismatch on [370434056192 4096]
ref mismatch on [371151822848 7766016] extent item 6, found 5
incorrect local backref count on 371151822848 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d0b80
backref disk bytenr does not match extent record, bytenr=371151822848, ref bytenr=0
backpointer mismatch on [371151822848 7766016]
ref mismatch on [371159588864 8740864] extent item 6, found 5
incorrect local backref count on 371159588864 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d0e90
backref disk bytenr does not match extent record, bytenr=371159588864, ref bytenr=0
backpointer mismatch on [371159588864 8740864]
ref mismatch on [371168329728 6361088] extent item 6, found 5
incorrect local backref count on 371168329728 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d11a0
backref disk bytenr does not match extent record, bytenr=371168329728, ref bytenr=0
backpointer mismatch on [371168329728 6361088]
ref mismatch on [371174690816 8245248] extent item 6, found 5
incorrect local backref count on 371174690816 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d14b0
backref disk bytenr does not match extent record, bytenr=371174690816, ref bytenr=0
backpointer mismatch on [371174690816 8245248]
ref mismatch on [371182936064 8511488] extent item 6, found 5
incorrect local backref count on 371182936064 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d17c0
backref disk bytenr does not match extent record, bytenr=371182936064, ref bytenr=0
backpointer mismatch on [371182936064 8511488]
ref mismatch on [371191451648 7585792] extent item 6, found 5
incorrect local backref count on 371191451648 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d1c00
backref disk bytenr does not match extent record, bytenr=371191451648, ref bytenr=0
backpointer mismatch on [371191451648 7585792]
ref mismatch on [371199037440 10190848] extent item 6, found 5
incorrect local backref count on 371199037440 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d1f10
backref disk bytenr does not match extent record, bytenr=371199037440, ref bytenr=0
backpointer mismatch on [371199037440 10190848]
ref mismatch on [371209228288 8036352] extent item 6, found 5
incorrect local backref count on 371209228288 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d2220
backref disk bytenr does not match extent record, bytenr=371209228288, ref bytenr=0
backpointer mismatch on [371209228288 8036352]
ref mismatch on [371217264640 5505024] extent item 6, found 5
incorrect local backref count on 371217264640 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d2530
backref disk bytenr does not match extent record, bytenr=371217264640, ref bytenr=0
backpointer mismatch on [371217264640 5505024]
ref mismatch on [371222769664 6688768] extent item 6, found 5
incorrect local backref count on 371222769664 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d2840
backref disk bytenr does not match extent record, bytenr=371222769664, ref bytenr=0
backpointer mismatch on [371222769664 6688768]
ref mismatch on [371229458432 8687616] extent item 6, found 5
incorrect local backref count on 371229458432 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d2b50
backref disk bytenr does not match extent record, bytenr=371229458432, ref bytenr=0
backpointer mismatch on [371229458432 8687616]
ref mismatch on [371238146048 6311936] extent item 6, found 5
incorrect local backref count on 371238146048 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d2e60
backref disk bytenr does not match extent record, bytenr=371238146048, ref bytenr=0
backpointer mismatch on [371238146048 6311936]
ref mismatch on [371244457984 7716864] extent item 6, found 5
incorrect local backref count on 371244457984 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d3170
backref disk bytenr does not match extent record, bytenr=371244457984, ref bytenr=0
backpointer mismatch on [371244457984 7716864]
ref mismatch on [371252174848 6545408] extent item 6, found 5
incorrect local backref count on 371252174848 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d3480
backref disk bytenr does not match extent record, bytenr=371252174848, ref bytenr=0
backpointer mismatch on [371252174848 6545408]
ref mismatch on [371258720256 7028736] extent item 6, found 5
incorrect local backref count on 371258720256 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d3790
backref disk bytenr does not match extent record, bytenr=371258720256, ref bytenr=0
backpointer mismatch on [371258720256 7028736]
ref mismatch on [371265748992 294912] extent item 6, found 5
incorrect local backref count on 371265748992 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d3aa0
backref disk bytenr does not match extent record, bytenr=371265748992, ref bytenr=0
backpointer mismatch on [371265748992 294912]
ref mismatch on [371286532096 81920] extent item 6, found 5
incorrect local backref count on 371286532096 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55efeb8d8260
backref disk bytenr does not match extent record, bytenr=371286532096, ref bytenr=0
backpointer mismatch on [371286532096 81920]
ref mismatch on [371456663552 524288] extent item 6, found 5
incorrect local backref count on 371456663552 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff24b7dc0
backref disk bytenr does not match extent record, bytenr=371456663552, ref bytenr=0
backpointer mismatch on [371456663552 524288]
ref mismatch on [371457187840 524288] extent item 6, found 5
incorrect local backref count on 371457187840 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff24b80d0
backref disk bytenr does not match extent record, bytenr=371457187840, ref bytenr=0
backpointer mismatch on [371457187840 524288]
ref mismatch on [371457712128 524288] extent item 6, found 5
incorrect local backref count on 371457712128 parent 519951286272 owner 0 offset 0 found 0 wanted 1 back 0x55eff24b83e0
backref disk bytenr does not match extent record, bytenr=371457712128, ref bytenr=0
backpointer mismatch on [371457712128 524288]
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space cache
block group 56929288192 has wrong amount of free space, free space cache has 20480 block group has 180224
failed to load free space cache for block group 56929288192
block group 166450954240 has wrong amount of free space, free space cache has 659456 block group has 704512
failed to load free space cache for block group 166450954240
block group 427370217472 has wrong amount of free space, free space cache has 402894848 block group has 402907136
failed to load free space cache for block group 427370217472
[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 455362232320 bytes used, error(s) found
total csum bytes: 436479016
total tree bytes: 6987612160
total fs tree bytes: 6209011712
total extent tree bytes: 233488384
btree space waste bytes: 1356910960
file data blocks allocated: 1026604879872
 referenced 984646426624

df shows confusing values

# df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/root             461G  425G     0 100% /mnt

Last edited by beachcoder (2023-10-25 11:21:22)

Offline

#2 2023-10-24 11:36:52

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,569

Re: [SOLVED] btrfs filesystem broken

but everywhere I read it is advised not to use the repair function of the tool.

Yes that's indeed what everyone warns about but I've run the repair command and it did fix my btrfs. The warning is there however so I would advise above everything else to make a backup of your most important files if you do decide to try the repair function.
You could also run smartctl just to see it's not your drive gone awry.

Offline

#3 2023-10-24 12:49:34

seth
Member
Registered: 2012-09-03
Posts: 51,532

Re: [SOLVED] btrfs filesystem broken

Not sure about everywhere™ but https://wiki.archlinux.org/title/Btrfs#btrfs_check simply warns that the tool isn't reliable and therefore advises to have backups, not to "not use it"
The alternative would be to wipe the partition and re-create the FS and restore all previous data - from a backup wink

tl;dr - backup is mandatory no matter what, then you can roll a dice and try "btrfs check --repair" and if that fails (in doubt: "spectacularily") you can still wipe the partition and recreate the FS and restore your backup.

Offline

#4 2023-10-24 13:02:16

beachcoder
Member
Registered: 2009-10-08
Posts: 130

Re: [SOLVED] btrfs filesystem broken

Thanks for your quick replies.

Sure, I do have backups, but only one each week. That's okay for now, and I'm doing it as d_fajardo said, backup the most current folders I've been working on and then trz to run "btrfs check --repair". I'll give you feedback if it succeeded or failed.

Offline

#5 2023-10-25 11:20:53

beachcoder
Member
Registered: 2009-10-08
Posts: 130

Re: [SOLVED] btrfs filesystem broken

Hi there,

here's a short feedback.

btrfs check --repair

didn't fix it. It repaired something, but the problems from above didn't go, so my thought was the SSD got corrupted. The SSD was 8 years old and 5-6 days a week on duty, therefore I think that's the problem. I then created a copy of the last backed up subvolumes and was able to rebuild the system, where I'm writing you from now.

TL;DR: Hardware issue, SSD corrupt.

Offline

#6 2023-11-05 02:35:36

PerfMonk
Member
Registered: 2016-04-21
Posts: 22

Re: [SOLVED] btrfs filesystem broken

You just discovered why I don't use btrfs anymore....  It tend to break and get corruption after a while (some months) and the repair tools are a big piece of sh...t.
Me will be using EXT4 for a long time.  May be xfs for /home but no more btrfs until it get more reliable on a laptop SSD.

;=)

Offline

Board footer

Powered by FluxBB