Filesystems

btrfs ref 和 backpointer 不匹配,範圍分配樹中的錯誤

  • September 12, 2019

我有一個加密的 LUKS 分區,上面有 btrfs 用於備份。

安裝系統並在備份期間執行接收/發送操作時發生核心崩潰。

重啟後 LUKS 本身沒有問題,但是在 btrfs 上發現了一些錯誤和警告:

btrfs ch -p /dev/mapper/bckp

Opening filesystem to check... Checking filesystem on /dev/mapper/bckp UUID: 4b793176-530a-4a82-b156-3363db035760 [1/7] checking root items (0:01:24 elapsed, 5200849 items checked) ref mismatch on [2351455076352 16384] extent item 0, found 1sed, 995581 items checked) tree backref 2351455076352 parent 6690 root 6690 not found in extent tree backpointer mismatch on [2351455076352 16384] [2/7] checking extents (0:04:33 elapsed, 997158 items checked) ERROR: errors found in extent allocation tree or chunk allocation [3/7] checking free space cache (0:00:30 elapsed, 4870 items checked) [4/7] checking fs roots (0:09:36 elapsed, 724856 items checked) [5/7] checking csums (without verifying data) (0:00:42 elapsed, 1691026 items checked) [6/7] checking root refs (0:00:00 elapsed, 223 items checked) [7/7] checking quota groups skipped (not enabled on this FS) found 3669056704512 bytes used, error(s) found total csum bytes: 3565923444 total tree bytes: 16333701120 total fs tree bytes: 11922030592 total extent tree bytes: 561364992 btree space waste bytes: 2285778795 file data blocks allocated: 49969135439872 referenced 5223974543360

我使用另一個超級塊或備份根樹來執行它,例如:

btrfs ch -p -s 1 /dev/mapper/bckp

btrfs ch -p -b /dev/mapper/bckp

但結果和數字完全相同。我沒有執行修復選項,因為它被標記為危險。

這些錯誤可以修復嗎?如何保存文件系統?

感謝 Emmanuel Rosa 的評論,您為我指明了正確的方向。

在我對已安裝的捲執行擦洗之後
btrfs sc start -Bd /dev/mapper/bckp

我得到了這個結果:

scrub device /dev/mapper/bckp (id 1) done scrub started at Thu Sep 12 13:28:38 2019 and finished after 05:12:29 total bytes scrubbed: 3.02TiB with 0 errors

日誌中沒有錯誤或警告。

所以我再次執行 btrfs 檢查,終於得到了乾淨的輸出:

bf ch -p /dev/mapper/bckp Opening filesystem to check... Checking filesystem on /dev/mapper/bckp UUID: 4b793176-530a-4a82-b156-3363db035760 [1/7] checking root items (0:01:27 elapsed, 5102746 items checked) [2/7] checking extents (0:04:15 elapsed, 969366 items checked) [3/7] checking free space cache (0:00:32 elapsed, 4871 items checked) [4/7] checking fs roots (0:09:14 elapsed, 720718 items checked)ked) [5/7] checking csums (without verifying data) (0:00:29 elapsed, 1557593 items checked) [6/7] checking root refs (0:00:00 elapsed, 222 items checked) [7/7] checking quota groups skipped (not enabled on this FS) found 3308474904576 bytes used, no error found total csum bytes: 3214237436 total tree bytes: 15878373376 total fs tree bytes: 11854004224 total extent tree bytes: 553287680 btree space waste bytes: 2253478467 file data blocks allocated: 49609008967680 referenced 4863848071168

我的軟體是:

btrfs version

btrfs-progs v4.19

uname -rom

4.19.57-gentoo x86_64 GNU/Linux`

所以FS乾淨又可以用了,沒有任何警告,謝謝你的幫助。

引用自:https://unix.stackexchange.com/questions/540024