TL;DR How to recover the
ext4
file system from a corrupted RAID1 partition?
My situation
I have one failed disk that belonged to an RAID1 array on a Synology DiskStation, the other one is lost.
Using ddrescue
I've copied most of the relevant data to a new disk.
The partition table survied, however some blocks essential to the RAID setup are corrupted.
# fdisk -l /dev/sdd
Disk /dev/sdd: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0003f44a
Device Boot Start End Blocks Id System
/dev/sdd1 256 4980735 2490240 fd Linux raid autodetect
/dev/sdd2 4980736 9175039 2097152 fd Linux raid autodetect
/dev/sdd3 9437184 3907024064 1948793440+ fd Linux raid autodetect
The actual data is on the third partition /dev/sdd3
, but mdadm
can't assemble the array.
# mdadm --examine /dev/sdd
/dev/sdd:
MBR Magic : aa55
Partition[0] : 4980480 sectors at 256 (type fd)
Partition[1] : 4194304 sectors at 4980736 (type fd)
Partition[2] : 3897586881 sectors at 9437184 (type fd)
# mdadm --examine /dev/sdd3
mdadm: No md superblock detected on /dev/sdd3.
As a result I am unable to mount the partition. The data is there and it is recognized by tools like foremost
.
I have also tried using extundelete
, but it fails without a proper ext superblock.
# extundelete --superblock /dev/sdd3
extundelete: failed to read-only open device "/dev/sdd3": Error code 2133571347
The question(s)
How to recover files and directories from a corrupted RAID1 partition?
Is there any way to recreate the md superblock
, without loosing the existing data?
Would it be possible to ignore the md parts, to treat the partition as a corrupted ext4
partition and recover it that way?