如何挂载一个 BTRFS 文件系统,其中两个设备都有 CHANGING_FSID 标志并且一个设备有日志错误?

如何挂载一个 BTRFS 文件系统,其中两个设备都有 CHANGING_FSID 标志并且一个设备有日志错误?

我有一个带有两个 8 TB 硬盘的 RAID-1 BTRFS 设置。由于不正常重启,我无法再挂载它们,即使使用恢复标志也是如此:

rockpro64:~:# mount -t btrfs -o rootflags=recovery,nospace_cache /dev/sda /srv/dev-disk-by-uuid-7aac1145-798b-4941-91e2-d6bada05c748
mount: /srv/dev-disk-by-uuid-7aac1145-798b-4941-91e2-d6bada05c748: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.

经过一番研究,我发现另一个有类似问题的人能够通过使用 更改 uuid 来解决问题btrfstune -u /dev/sda。所以我运行了该命令,现在我的驱动器似乎陷入了不断变化的 fsid 情况。为了完成更改 uuid,我应该再次运行该命令,但在两个驱动器连接的情况下运行该命令时,出现了以下错误:

rockpro64:~:# btrfs check --readonly /dev/sda   
Opening filesystem to check...
ERROR: Filesystem UUID change in progress
ERROR: cannot open file system
rockpro64:~:# btrfstune -u /dev/sda
WARNING: it's recommended to run 'btrfs check --readonly' before this operation.
    The whole operation must finish before the filesystem can be mounted again.
    If cancelled or interrupted, run 'btrfstune -u' to restart.
We are going to change UUID, are your sure? [y/N]: y
Current fsid: 7aac1145-798b-4941-91e2-d6bada05c748
New fsid: 7aac1145-798b-4941-91e2-d6bada05c748
Set superblock flag CHANGING_FSID
Change fsid in extents
parent transid verify failed on 2500093132800 wanted 562468 found 562371
parent transid verify failed on 2500093132800 wanted 562468 found 562371
parent transid verify failed on 2500093132800 wanted 562468 found 562371
Ignoring transid failure
parent transid verify failed on 728970788864 wanted 562440 found 562429
parent transid verify failed on 728970788864 wanted 562440 found 562429
parent transid verify failed on 728970788864 wanted 562440 found 562429
Ignoring transid failure
parent transid verify failed on 728779194368 wanted 562441 found 562431
parent transid verify failed on 728779194368 wanted 562441 found 562431
parent transid verify failed on 728779194368 wanted 562441 found 562431
Ignoring transid failure
parent transid verify failed on 728779210752 wanted 562441 found 562431
parent transid verify failed on 728779210752 wanted 562441 found 562431
parent transid verify failed on 728779210752 wanted 562441 found 562431
Ignoring transid failure
parent transid verify failed on 729093505024 wanted 562440 found 562429
parent transid verify failed on 729093505024 wanted 562440 found 562429
parent transid verify failed on 729093505024 wanted 562440 found 562429
Ignoring transid failure
parent transid verify failed on 728622661632 wanted 562441 found 562430
parent transid verify failed on 728622661632 wanted 562441 found 562430
parent transid verify failed on 728622661632 wanted 562441 found 562430
Ignoring transid failure
parent transid verify failed on 728977375232 wanted 562440 found 562433
parent transid verify failed on 728977375232 wanted 562440 found 562433
parent transid verify failed on 728977375232 wanted 562440 found 562433
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=2500078845952 item=164 parent level=1 child bytenr=728977375232 child level=1
ERROR: failed to change UUID of metadata: -5
ERROR: btrfstune failed

似乎设备日志和磁盘上的数据不同步。我试过,btrfs rescue zero-log但这不起作用,因为文件系统 uuid 更改已在进行中:

rockpro64:~:# btrfs rescue zero-log /dev/sda
ERROR: Filesystem UUID change in progress
ERROR: could not open ctree

因此,我尝试断开导致上述错误的硬盘,然后再次运行该命令,以便将其从更改 fsid 模式中移除并挂载。但这会导致btrfstune段错误。

rockpro64:~:# btrfstune -u /dev/sda                                                                
warning, device 2 is missing
WARNING: it's recommended to run 'btrfs check --readonly' before this operation.
    The whole operation must finish before the filesystem can be mounted again.
    If cancelled or interrupted, run 'btrfstune -u' to restart.
We are going to change UUID, are your sure? [y/N]: y
Current fsid: 7aac1145-798b-4941-91e2-d6bada05c748
New fsid: 7aac1145-798b-4941-91e2-d6bada05c748
Set superblock flag CHANGING_FSID
[1]    2764 segmentation fault  btrfstune -u /dev/sda

所以,我现在基本陷入了困境。我无法完成更改 fsid,因为第二个硬盘有错误。我也无法将日志清零以修复这些错误,因为 fsid 更改正在进行中。我打算用一btrfs recover整夜的时间来备份磁盘上的数据,但我真的很想修复这些问题。

您知道我下一步可以尝试什么吗?如果需要,我还可以提供超级块的转储(看起来还不错,只是它们有 CHANGING_FSID 标志)。我已经考虑过十六进制编辑 CHANGING_FSID 标志...对此有什么建议吗?

相关内容