我有一个加密的 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
但结果和数字完全相同。我没有运行修复选项,因为它被标记为危险。
这些错误可以修复吗?如何保存文件系统?
答案1
感谢 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 又干净又可用,没有任何警告,谢谢你帮助我。