求助,btrfs 变成 read-only

用的最新的 tumbleweed,晚上突然发现文件系统变成只读的。

运行 btrfs check 反而得到 out of memory:

...................................很多类似的行
WARNING: tree block [1073987584, 1074003968) crosses 64K page boudnary, may cause problem for 64K page system
WARNING: tree block [1074053120, 1074069504) crosses 64K page boudnary, may cause problem for 64K page system
WARNING: tree block [1074118656, 1074135040) crosses 64K page boudnary, may cause problem for 64K page system
WARNING: tree block [1074184192, 1074200576) crosses 64K page boudnary, may cause problem for 64K page system
WARNING: tree block [1074249728, 1074266112) crosses 64K page boudnary, may cause problem for 64K page system
[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
ERROR: out of memory
ERROR: Loading qgroups from disk: -2
ERROR: failed to check quota groups
found 71455006720 bytes used, error(s) found
total csum bytes: 63871560
total tree bytes: 3487645696
total fs tree bytes: 3292364800
total extent tree bytes: 109395968
btree space waste bytes: 640544373
file data blocks allocated: 276465897472
 referenced 221541310464
extent buffer leak: start 469499904 len 16384
extent buffer leak: start 404537344 len 16384

请问大家有没有线索这是怎么回事?怎么避免 btrfs check out of memory 呢?(电脑的内存是 32G 应该足够了)

用 btrfs check --mode lowmem 试着跑了一下,还得到了:

[3/7] checking free space cache                (0:00:01 elapsed, 85 items checked)
ERROR: root 258 EXTENT_DATA[210543 4096] gap exists, expected: EXTENT_DATA[210543 256]

以及很多类似这样的错误:

ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
ERROR: root 1321 DIR ITEM[90577 3719653934] missing name ksycoca5_en_zzBTQGNOoeFvUqv9k8GEg3_R1HY= filetype 1
ERROR: root 1321 DIR INDEX[90577 4111] missing name ksycoca5_en_zzBTQGNOoeFvUqv9k8GEg3_R1HY= filetype 1
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
ERROR: root 1321 DIR ITEM[90556 1946503298] missing name history2.lst filetype 1
ERROR: root 1321 DIR INDEX[90556 22492] missing name history2.lst filetype 1
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
ERROR: root 1321 DIR ITEM[258 2670046935] missing name .bash_history filetype 1
ERROR: root 1321 DIR INDEX[258 2293] missing name .bash_history filetype 1
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
ERROR: root 1321 DIR ITEM[90568 3239139256] missing name konsolerc filetype 1
ERROR: root 1321 DIR INDEX[90568 16108] missing name konsolerc filetype 1
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
parent transid verify failed on 108950388736 wanted 93286 found 96893
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=108970246144 item=0 parent level=2 child bytenr=108950388736 child level=0
ERROR: root 1321 DIR ITEM[90577 1119642003] missing name plasma-svgelements filetype 1
ERROR: root 1321 DIR INDEX[90577 4114] missing name plasma-svgelements filetype 1

最后:

[4/7] checking fs roots                        (0:02:38 elapsed, 183840 items checked)
ERROR: errors found in fs roots
found 71461675008 bytes used, error(s) found
total csum bytes: 63871560
total tree bytes: 3487629312
total fs tree bytes: 3292348416
total extent tree bytes: 109395968
btree space waste bytes: 640535826
file data blocks allocated: 276465897472
 referenced 221541310464

先备份下重要数据,然后 btrfs check --repair?

我也是这么想的,但是还是会出现之前 out of memory 的错,而 --mode lowmem 并不能用于 btrfs check --repair :https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-check

@pikkaB

先把 quota 禁用了再 check?

btrfs rescue disable-quota /dev/sdXXX

搜到的:https://www.spinics.net/lists/linux-btrfs/msg81169.html

苏大人!试着编译运行了那个命令,但是依然会有 out of memory 的错误。看到一个类似的帖子 https://bbs.archlinux.org/viewtopic.php?id=233724 ,现在我在尝试运行 btrfsck --init-extent-tree

但是!已经过了好几个小时了还没结束 :upside_down_face: 我打算等它跑一周还没结束的话就 reformat 了

最后 update 一下:btrfs check --init-extent-tree 跑了一天之后最后修正了问题~

本主题在最后一个回复创建后60分钟后自动锁定。不再允许添加新回复。