Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sudden BTRFS failure
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
lostmeeee
n00b
n00b


Joined: 13 Feb 2025
Posts: 1

PostPosted: Thu Feb 13, 2025 6:20 pm    Post subject: Sudden BTRFS failure Reply with quote

Hello, this is my first post in the Gentoo Forums.

A few days ago, a power outage happened while I had a btrfs partition mounted. My computer shut off, and I only came to use that partition again today. However, when trying to mount, even specifying the type of the partition, the following is found:
Code:

# mount -t btrfs -o compress-force=zstd /dev/mapper/s1 /mnt/ssd
mount: /mnt/ssd: can't read superblock on /dev/mapper/s1.
       dmesg(1) may have more information after failed mount system call.


Dmesg:
Code:
 
BTRFS error (device dm-2): bad tree block start, mirror 1 want 23642112 have 11738718632178979669
BTRFS error (device dm-2): bad tree block start, mirror 2 want 23642112 have 9946923798501279660
BTRFS error (device dm-2): failed to read chunk tree: -5
BTRFS error (device dm-2): open_ctree failed


We can see that those start bytes are ridiculous.

Other partitions in the same hardware device are still working. No data lost.
By the way, the btrfs is encrypted with luks2.

I ran smartctl long as well, however the attempts are being shown in the log as

Code:

# 1  Extended offline    Aborted by host               00%      1851
# 2  Extended offline    Aborted by host               00%      1849


What worries me the most: the amount of Unknown_Attribute:
Code:

SMART Attributes Data Structure revision number: 20
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0013   100   100   050    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       1852
 12 Power_Cycle_Count       0x0012   100   100   000    Old_age   Always       -       185
167 Unknown_Attribute       0x0022   100   100   000    Old_age   Always       -       0
168 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       4844723109888
169 Unknown_Attribute       0x0013   100   100   010    Pre-fail  Always       -       327690
171 Unknown_Attribute       0x0032   000   000   000    Old_age   Always       -       0
172 Unknown_Attribute       0x0032   000   000   000    Old_age   Always       -       0
173 Unknown_Attribute       0x0012   200   200   000    Old_age   Always       -       12888702996
175 Program_Fail_Count_Chip 0x0022   100   100   010    Old_age   Always       -       0
177 Wear_Leveling_Count     0x0012   100   100   000    Old_age   Always       -       247800667
180 Unused_Rsvd_Blk_Cnt_Tot 0x0033   100   100   000    Pre-fail  Always       -       199
187 Reported_Uncorrect      0x0032   100   000   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0012   100   100   000    Old_age   Always       -       151
194 Temperature_Celsius     0x0022   056   056   000    Old_age   Always       -       56 (Min/Max 34/64)
196 Reallocated_Event_Count 0x0012   100   100   000    Old_age   Always       -       0
199 UDMA_CRC_Error_Count    0x0012   100   100   000    Old_age   Always       -       0
206 Unknown_SSD_Attribute   0x0032   200   200   000    Old_age   Always       -       3
207 Unknown_SSD_Attribute   0x0032   200   200   000    Old_age   Always       -       58
208 Unknown_SSD_Attribute   0x0032   200   200   000    Old_age   Always       -       20
209 Unknown_SSD_Attribute   0x0032   200   200   000    Old_age   Always       -       1
210 Unknown_Attribute       0x0032   200   200   000    Old_age   Always       -       320
211 Unknown_Attribute       0x0032   200   200   000    Old_age   Always       -       159
231 Unknown_SSD_Attribute   0x0023   099   099   005    Pre-fail  Always       -       1
241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       1718
242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       1093
245 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       30920407201763


When running btrfs check:

Code:

btrfs check /dev/mapper/s1
Opening filesystem to check...
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
checksum verify failed on 23642112 wanted 0x2d6a18d7 found 0x63d2c823
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
bad tree block 23642112, bytenr mismatch, want=23642112, have=11738718632178979669
Couldn't read chunk tree
ERROR: cannot open file system


With --repair, the same happens.

Interestingly:

Code:

# btrfs rescue chunk-recover /dev/mapper/s1
Scanning: 60784640 in dev0Segmentation fault

# btrfs rescue super-recover /dev/mapper/s1
All supers are valid, no need to recover

# btrfs restore -D /dev/mapper/s1 /tmp/
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
checksum verify failed on 23642112 wanted 0x2d6a18d7 found 0x63d2c823
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
bad tree block 23642112, bytenr mismatch, want=23642112, have=11738718632178979669
Couldn't read chunk tree
Could not open root, trying backup super
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
checksum verify failed on 23642112 wanted 0x2d6a18d7 found 0x63d2c823
checksum verify failed on 23642112 wanted 0xc3ba9f06 found 0x62fcfc3c
bad tree block 23642112, bytenr mismatch, want=23642112, have=11738718632178979669
Couldn't read chunk tree
Could not open root, trying backup super
ERROR: superblock bytenr 274877906944 is larger than device size 214731587584
Could not open root, trying backup super


I searched online but could not find anything about it. What gets me is that the other partitions are still working.

Thanks in advance.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2154

PostPosted: Fri Feb 14, 2025 1:32 pm    Post subject: Reply with quote

I don't have actual advice on solving this but I'll suggest visiting #btrfs on IRC (libera.chat). They're very helpful over there.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum