![btrfs 尝试恢复文件系统 - 坏树块](https://linux22.com/image/166709/btrfs%20%E5%B0%9D%E8%AF%95%E6%81%A2%E5%A4%8D%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%20-%20%E5%9D%8F%E6%A0%91%E5%9D%97.png)
我希望有人可以帮助我,尝试恢复丢失第一个驱动器的 btrfs 池。我尝试安装第二个驱动器,但出现文件系统错误。
我使第一个驱动器再次可读,但似乎它丢失了文件系统,但尚未格式化。也没有。
请问有人可以帮忙吗?
设备:
- /dev/nvme0n1p1
- /dev/nvme1n1p1
root@blaster:~# btrfs rescue super-recover -v /dev/nvme0n1p1
No valid Btrfs found on /dev/nvme0n1p1
Usage or syntax errors
root@blaster:~# btrfs-find-root /dev/nvme0n1p1
No valid Btrfs found on /dev/nvme0n1p1
ERROR: open ctree failed
root@blaster:~# btrfs rescue super-recover -v /dev/nvme1n1p1
All Devices:
Device: id = 1, name = /dev/nvme1n1p1
Before Recovering:
[All good supers]:
device name = /dev/nvme1n1p1
superblock bytenr = 65536
device name = /dev/nvme1n1p1
superblock bytenr = 67108864
[All bad supers]:
All supers are valid, no need to recover
root@blaster:~# btrfs-find-root /dev/nvme1n1p1
Couldn't setup device tree
Superblock thinks the generation is 1799818
Superblock thinks the level is 1
Found tree root at 481771520 gen 1799818 level 1
Well block 480296960(gen: 1799817 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 467337216(gen: 1799816 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 453623808(gen: 1799815 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 438878208(gen: 1799814 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 423870464(gen: 1799813 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 408272896(gen: 1799812 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 375799808(gen: 1799811 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 354533376(gen: 1799810 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 332218368(gen: 1799809 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 319455232(gen: 1799808 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 305397760(gen: 1799807 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 289013760(gen: 1799806 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 216956928(gen: 1799801 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 201883648(gen: 1799800 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 185024512(gen: 1799799 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 171786240(gen: 1799798 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 144621568(gen: 1799797 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 112836608(gen: 1799796 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 89767936(gen: 1799795 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 63324160(gen: 1799794 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 47841280(gen: 1799793 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 30490624(gen: 1799792 level: 1) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
Well block 428605440(gen: 1798782 level: 0) seems good, but generation/level doesn't match, want gen: 1799818 level: 1
root@blaster:~# btrfs check --tree-root 481771520 --super 1 /dev/nvme1n1p1
using SB copy 1, bytenr 67108864
Opening filesystem to check...
bad tree block 479137857536, bytenr mismatch, want=479137857536, have=0
Couldn't setup device tree
ERROR: cannot open file system
root@blaster:~# btrfs check --tree-root 480296960 --super 1 /dev/nvme1n1p1
using SB copy 1, bytenr 67108864
Opening filesystem to check...
parent transid verify failed on 480296960 wanted 1799818 found 1799817
parent transid verify failed on 480296960 wanted 1799818 found 1799817
Ignoring transid failure
bad tree block 479137857536, bytenr mismatch, want=479137857536, have=0
Couldn't setup device tree
ERROR: cannot open file system
root@blaster:~# btrfs restore -iv /dev/nvme1n1p1 /mnt/user/backups/restore_cache/
bad tree block 479137857536, bytenr mismatch, want=479137857536, have=0
Couldn't setup device tree
Could not open root, trying backup super
bad tree block 479137857536, bytenr mismatch, want=479137857536, have=0
Couldn't setup device tree
Could not open root, trying backup super
ERROR: superblock bytenr 274877906944 is larger than device size 250059317248
Could not open root, trying backup super