btrfs ls 获取无效的根标志

btrfs ls 获取无效的根标志

3 个月前,断电后,我们的 Synology NAS DS415+ 开始重启,持续 5 分钟然后重启。我们最近尝试从中恢复数据,2*3TB SHR-RAID 1。

经过很长的路程Synology 文档,我毫无问题地安装了 raid,当我ls在文件夹中运行经典时,出现以下错误:

ls: cannot access '/mnt/FOLDERA': Input/output error
FOLDERA
FOLDERB

我尝试运行ls /mnt/FOLDERA,但出现了同样的 io 错误。我也尝试了文件夹 B,访问该文件夹没有任何问题。

我还尝试在没有 raid 的情况下安装磁盘,两个磁盘都出现了同样的问题。查看 dmesg,每次我尝试访问任何 io 错误文件夹时,我都会收到以下日志:

[109433.244496] BTRFS error (device dm-0): block=133562368 read time tree block corruption detected
[109433.301567] BTRFS critical (device dm-0): corrupt leaf: root=1 block=133070848 slot=30, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109433.301575] BTRFS error (device dm-0): block=133070848 read time tree block corruption detected
[109433.301876] BTRFS critical (device dm-0): corrupt leaf: root=1 block=133070848 slot=30, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109433.301883] BTRFS error (device dm-0): block=133070848 read time tree block corruption detected
[109441.972111] BTRFS critical (device dm-0): corrupt leaf: root=1 block=132923392 slot=17, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109441.972121] BTRFS error (device dm-0): block=132923392 read time tree block corruption detected
[109441.972356] BTRFS critical (device dm-0): corrupt leaf: root=1 block=132923392 slot=17, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109441.972362] BTRFS error (device dm-0): block=132923392 read time tree block corruption detected
[109449.284056] BTRFS critical (device dm-0): corrupt leaf: root=1 block=132923392 slot=17, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109449.284066] BTRFS error (device dm-0): block=132923392 read time tree block corruption detected
[109449.284318] BTRFS critical (device dm-0): corrupt leaf: root=1 block=132923392 slot=17, invalid root flags, have 0x200000000 expect mask 0x1000000000001
[109449.284323] BTRFS error (device dm-0): block=132923392 read time tree block corruption detected

所以我的问题似乎出在 btrFS 上,所以我尝试了清理

UUID:             f9995e41-6f97-41e8-bf0a-31f83c9e8314
Scrub started:    Wed Aug  5 08:53:01 2020
Status:           finished
Duration:         3:10:00
Total to scrub:   1.20TiB
Rate:             110.51MiB/s
Error summary:    no errors found

也可以恢复,但似乎无法找到根块。

btrfs-find-root /dev/vg1000/lv
Superblock thinks the generation is 3391864
Superblock thinks the level is 1
Found tree root at 656900096 gen 3391864 level 1
Well block 642072576(gen: 3391863 level: 1) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 341000192(gen: 3391845 level: 0) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 299876352(gen: 3391844 level: 1) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 190988288(gen: 3391842 level: 0) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 159334400(gen: 3391841 level: 1) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 88440832(gen: 3391840 level: 1) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
........................................... ~50 lines ...
Well block 4243456(gen: 3 level: 0) seems good, but generation/level doesn't match, want gen: 3391864 level: 1
Well block 4194304(gen: 2 level: 0) seems good, but generation/level doesn't match, want gen: 3391864 level: 1

我唯一没有尝试的是 btrfs 检查,因为它似乎是一个非常危险的命令。

我如何挂载所有数据以使其可访问?我目前在 ubuntu 20.04 live-usb 密钥上运行,以便能够在机器中挂载磁盘。

答案1

我遇到了同样的问题,因为完整的 btrfs

我无法在 Fedora 36 工作站上安装 SHR。它会抛出一个invalid root flags错误。

我卸下了两个硬盘,并将它们安装在外部 3.5 英寸硬盘 USB 外壳中。然后我使用另一个硬盘(或 +2 托架系统中的备用硬盘)重新安装 DSM。然后我使用终端删除了 btrfs 快照。

btrfs sub list .

如果你看到@sharesnap- 它们可以安全删除

btrfs sub del \@sharesnap/*/*
btrfs sub del \@sharesnap/*
btrfs sub del \@sharesnap

只要有空闲空间,btrfs 就会开始回收空间。

之后,将 2 个原始 HDD 重新插入系统并移除备用 HDD。启动,等待系统上线,插入备用 HDD,格式化备用 HDD 并将其添加到 SHR。

也很有帮助。

相关内容