How can I assemble a RAID5 array using mdadm
, if my disks are actually partitions, and some of them are image files, rather than actual disks? I'm using Ubuntu 18.04
I have an old RAID 5 array that I want to recover. It once consisted of three 2 TB disks, each with a single 2TB partition on it. I have two of them as image files (created with dd
), and one as the actual HDD. I was hoping to access the RAID5 array's contents, but I'm not able to even reassemble the array, let alone mount it. Here's what I tried:
Create loop devices for the image files
losetup -Pf image1.iso
losetup -Pf image2.iso
Create a custom ~/raid-mdadm.conf
DEVICE /dev/sdc1
DEVICE /dev/loop17p1
DEVICE /dev/loop33p1
Try to run mdadm --assemble
mdamd --assemble --scan --verbose --config=~raid-mdadm.conf
however, this fails with the following error:
mdadm: looking for devices for further assembly
mdadm: Merging with already-assembled /dev/md/0
mdadm: cannot re-read metadata from /dev/dm-8 - aborting
double free or corruption (!prev)
Aborted (core dumped)
If I don't specify my custom --config
option, or if I use --config=partitions
, the output shows that it doesn't actually consider /dev/sdc1
, /dev/loop17p1
, or /dev/loop33p1
in the --scan
phase.
PS: If you're wondering why there's these partitions involved, don't ask me. I don't remember why I decided that over 10y ago. If you're wondering why I don't either have all disks, or all images, this is because my computer doesn't seem to want to recognize more than one disk at at time, and I don't have enough free storage for a 3rd image and the data I want to recover.
PS2: I'd also be happy to reassemble my RAID array using something other than mdadm
/dev/md/0
... After all, it is not clear, it is assembled in this way or it is only an error in the configuration file. It block/0
now. – Mar 12 '21 at 10:02~/raid-mdadm.conf
file was to instructmdadm
to use the correct partitions, because without it, it would not look at those. – derabbink Mar 12 '21 at 16:49