fsck raid10 ext4 分区损坏,恢复数据

fsck raid10 ext4 分区损坏,恢复数据

raid10 中有一个卷,/dev/md3 它有一个 ext4 中的 GPT 分区/dev/md3p1,大小为 16TB。

我不小心跑了

fsck -y /dev/md3

导致文件系统/dev/md3p1损坏。

fsck -b superblock_number /dev/md3p1任何超级块都会mkfs -n /dev/md3p1返回错误。

testdisk 可以/dev/md3看到 ext4 分区,但是/dev/md3p1什么也看不到。

如何恢复数据或分区?

sudo parted -l /dev/md3

Model: ATA WDC WD8003FFBX-6 (scsi)
Disk /dev/sda: 8002G
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  538MB   537MB   fat32              boot, esp
 2      538MB   1612MB  1074MB
 3      1612MB  55.3GB  53.7GB
 4      55.3GB  66.0GB  10.7GB
 5      66.0GB  8002GB  7936GB


Model: ATA WDC WD8003FFBX-6 (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  538MB   537MB   fat32              boot, esp
 2      538MB   1612MB  1074MB
 3      1612MB  55.3GB  53.7GB
 4      55.3GB  66.0GB  10.7GB
 5      66.0GB  8002GB  7936GB


Model: ATA WDC WD8003FFBX-6 (scsi)
Disk /dev/sdc: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  538MB   537MB   fat32              boot, esp
 2      538MB   1612MB  1074MB
 3      1612MB  55.3GB  53.7GB
 4      55.3GB  66.0GB  10.7GB
 5      66.0GB  8002GB  7936GB


Model: ATA WDC WD8003FFBX-6 (scsi)
Disk /dev/sdd: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  538MB   537MB   fat32              boot, esp
 2      538MB   1612MB  1074MB
 3      1612MB  55.3GB  53.7GB
 4      55.3GB  66.0GB  10.7GB
 5      66.0GB  8002GB  7936GB

sudo mount /dev/md3p1 /1

mount: /1: wrong fs type, bad option, bad superblock on /dev/md3p1, missing codepage or helper program, or other error.

sudo mkfs -n /dev/md3p1



mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 3874701824 4k blocks and 484339712 inodes
Filesystem UUID: dc34be44-6f5a-47ac-a841-cbb75625b9b0
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
    2560000000, 3855122432

sudo fsck -b 32768 /dev/md3p1

fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
fsck.ext2: Bad magic number in super-block while trying to open /dev/md3p1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:

    e2fsck -b 8193 <device>

 or

    e2fsck -b 32768 <device>

cat /proc/mdstat


Personalities : [raid1] [raid10] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] 
md0 : active raid1 sdc2[6] sdb2[5] sda2[4] sdd2[0]
      1046528 blocks super 1.2 [4/4] [UUUU]
      
md1 : active raid1 sdb3[6] sdc3[5] sdd3[0] sda3[4]
      52395008 blocks super 1.2 [4/4] [UUUU]
      
md2 : active raid10 sdb4[5] sda4[4] sdc4[3] sdd4[0]
      20953088 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
      
md3 : active raid10 sda5[1] sdd5[0] sdc5[3] sdb5[2]
      15498811392 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
      bitmap: 0/116 pages [0KB], 65536KB chunk

答案1

如果您已经尝试了所有超级块,您可能需要查看 mke2fs 的 man mage,并可能尝试使用 -S 重新初始化超级块和组描述符(首先,请参阅手册页中的警告)。

...您需要随后立即运行 fsck,并掌握正确的块大小。

相关内容