多次断电后,btrfs 的校验和错误,可以恢复吗?
配备 PERC H730P 适配器的 Dell R740xd 出现故障,好像缓存未被写入。
现在尝试使用 btrfs-progs v6.5.1 在 fedora 中恢复
二甲基硅油在山上
[ 7471.519489] BTRFS: device fsid 3e7baffe-c84f-4bf1-a830-84adb5899539 devid 1 transid 1197903 /dev/xvdb1 scanned by mount (1536)
[ 7471.524090] BTRFS info (device xvdb1): using crc32c (crc32c-intel) checksum algorithm
[ 7471.524099] BTRFS info (device xvdb1): disk space caching is enabled
[ 7481.606391] BTRFS info (device xvdb1): enabling ssd optimizations
[ 7481.629116] BTRFS warning (device xvdb1): checksum verify failed on logical 4317118464 mirror 1 wanted 0x4b93e5a3 found 0x743b8159 level 1
山返回
mount: /temp: can't read superblock on /dev/xvdb1.
dmesg(1) may have more information after failed mount system call.
安装-oro,救援=usebackuproot /dev/xvdb1 /temp/ 给出相同的输出
btrfs 救援超级恢复 -v /dev/xvdb1
All Devices:
Device: id = 1, name = /dev/xvdb1
Before Recovering:
[All good supers]:
device name = /dev/xvdb1
superblock bytenr = 65536
device name = /dev/xvdb1
superblock bytenr = 67108864
device name = /dev/xvdb1
superblock bytenr = 274877906944
[All bad supers]:
All supers are valid, no need to recover
btrfs 恢复 /dev/xvdb1 /temp/
checksum verify failed on 4317118464 wanted 0x4b93e5a3 found 0x743b8159
checksum verify failed on 4317118464 wanted 0x4b93e5a3 found 0x743b8159
Csum didn't match
ERROR: search for next directory entry failed: -5
完整超级块信息
[root@localhost |]# btrfs inspect-internal dump-super -f /dev/xvdb1
superblock: bytenr=65536, device=/dev/xvdb1
---------------------------------------------------------
csum_type 0 (crc32c)
csum_size 4
csum 0xb72b3f47 [match]
bytenr 65536
flags 0x1
( WRITTEN )
magic _BHRfS_M [match]
fsid 3e7baffe-c84f-4bf1-a830-84adb5899539
metadata_uuid 00000000-0000-0000-0000-000000000000
label
generation 1197903
root 4328472576
sys_array_size 97
chunk_root_generation 1197057
root_level 1
chunk_root 1097728
chunk_root_level 1
log_root 0
log_root_transid (deprecated) 0
log_root_level 0
total_bytes 2147482599424
bytes_used 1786107740160
sectorsize 4096
nodesize 16384
leafsize (deprecated) 16384
stripesize 4096
root_dir 6
num_devices 1
compat_flags 0x0
compat_ro_flags 0x0
incompat_flags 0x161
( MIXED_BACKREF |
BIG_METADATA |
EXTENDED_IREF |
SKINNY_METADATA )
cache_generation 1197903
uuid_tree_generation 1197903
dev_item.uuid 8c6fd39f-1924-4314-9454-4c4a91999731
dev_item.fsid 3e7baffe-c84f-4bf1-a830-84adb5899539 [match]
dev_item.type 0
dev_item.total_bytes 2147482599424
dev_item.bytes_used 1855438454784
dev_item.io_align 4096
dev_item.io_width 4096
dev_item.sector_size 4096
dev_item.devid 1
dev_item.dev_group 0
dev_item.seek_speed 0
dev_item.bandwidth 0
dev_item.generation 0
sys_chunk_array[2048]:
item 0 key (FIRST_CHUNK_TREE CHUNK_ITEM 1048576)
length 4194304 owner 2 stripe_len 65536 type SYSTEM|single
io_align 4096 io_width 4096 sector_size 4096
num_stripes 1 sub_stripes 0
stripe 0 devid 1 offset 1048576
dev_uuid 8c6fd39f-1924-4314-9454-4c4a91999731
backup_roots[4]:
backup 0:
backup_tree_root: 4328472576 gen: 1197903 level: 1
backup_chunk_root: 1097728 gen: 1197057 level: 1
backup_extent_root: 4328636416 gen: 1197903 level: 3
backup_fs_root: 4379639808 gen: 1197899 level: 2
backup_dev_root: 4377640960 gen: 1197903 level: 1
csum_root: 4379656192 gen: 1197903 level: 2
backup_total_bytes: 2147482599424
backup_bytes_used: 1786107740160
backup_num_devices: 1
backup 1:
backup_tree_root: 4317069312 gen: 1197900 level: 1
backup_chunk_root: 1097728 gen: 1197057 level: 1
backup_extent_root: 4317429760 gen: 1197900 level: 3
backup_fs_root: 4379639808 gen: 1197899 level: 2
backup_dev_root: 4325916672 gen: 1197900 level: 1
csum_root: 4327030784 gen: 1197900 level: 2
backup_total_bytes: 2147482599424
backup_bytes_used: 1786107740160
backup_num_devices: 1
backup 2:
backup_tree_root: 4328636416 gen: 1197901 level: 1
backup_chunk_root: 1097728 gen: 1197057 level: 1
backup_extent_root: 4328652800 gen: 1197901 level: 3
backup_fs_root: 4379639808 gen: 1197899 level: 2
backup_dev_root: 4378968064 gen: 1197901 level: 1
csum_root: 4379738112 gen: 1197901 level: 2
backup_total_bytes: 2147482599424
backup_bytes_used: 1786107740160
backup_num_devices: 1
backup 3:
backup_tree_root: 4317069312 gen: 1197902 level: 1
backup_chunk_root: 1097728 gen: 1197057 level: 1
backup_extent_root: 4317429760 gen: 1197902 level: 3
backup_fs_root: 4379639808 gen: 1197899 level: 2
backup_dev_root: 4326195200 gen: 1197902 level: 1
csum_root: 4327096320 gen: 1197902 level: 2
backup_total_bytes: 2147482599424
backup_bytes_used: 1786107740160
backup_num_devices: 1
有磁盘的 dd 副本,因此有机会尝试多种修复方法。数据已备份,但这块硬盘有 1 个月的最新数据。