我无法挂载 btrfs 分区

我无法挂载 btrfs 分区

我有一个包含 3 个磁盘的 raid 5 阵列,使用btrfs(由 raid 提供btrfs)其中一个磁盘已损坏,我通过以下方式更换了磁盘:

btrfs device add /dev/sdc /media/raid/ 
btrfs device delete missing /media/raid/ 

这迫使磁盘之间进行重新平衡,之后 FS 就正常了。

重启一次后:

[11152.188020] BTRFS info (device sdb): enabling auto defrag 
[11152.188028] BTRFS info (device sdb): disk space caching is enabled 
[11152.189762] BTRFS: failed to read chunk tree on sdb 
[11152.196224] BTRFS: open_ctree failed 

pc ~ # mount -a 
mount: wrong fs type, bad option, bad superblock on /dev/sde, 
missing codepage or helper program, or other error 

syslog在某些情况下,可以在- 尝试 dmesg | tail左右找到有用的信息。

操作系统首先注释掉 中的该行fstab,之后我取消了该行的注释。

LABEL="raid" /media/raid btrfs compress=lzo,noatime,autodefrag

我使用的是 Gentoo Linux,内核 4.0.5。

这里是btrfs fi表演:

Label: 'raid'  uuid: 906ed4e3-52c5-4eb7-bd06-4810c0b84902
Total devices 3 FS bytes used 775.29GiB
devid    1 size 931.51GiB used 390.06GiB path /dev/sdb
devid    3 size 931.51GiB used 390.04GiB path /dev/sde
devid    4 size 931.51GiB used 390.03GiB path /dev/sdc


pc / # btrfs-find-root /dev/sdc
Superblock thinks the generation is 1758
Superblock thinks the level is 0
Found tree root at 30818304 gen 1758 level 0
Well block 30457856(gen: 1757 level: 0) seems good, but generation/level doesn't match, want gen: 1758 level: 0
Well block 29753344(gen: 1590 level: 0) seems good, but generation/level doesn't match, want gen: 1758 level: 0
Well block 29507584(gen: 1589 level: 0) seems good, but generation/level doesn't match, want gen: 1758 level: 0
Well block 4243456(gen: 3 level: 0) seems good, but generation/level doesn't match, want gen: 1758 level: 0
Well block 4194304(gen: 2 level: 0) seems good, but generation/level doesn't match, want gen: 1758 level: 0

答案1

您是否尝试使用该选项安装卷recovery

man mount

恢复:如果在安装时发现错误的树根,则启用自动恢复尝试。目前,它会扫描之前几个树根的列表,并尝试使用第一个可读的。

mount -o recovery /dev/sdb /media/raid

相关内容