How to attach an existing RAID1 to a fresh Linux system?

Well, I did it, and it turned out to be quite painless: the old RAID setup was automatically detected as /dev/md0, so all I had to do was mount /dev/md0 /mnt, then copy all the data from it to whereever appropriate.

After that I issued:

mdadm --stop /dev/md0
mdadm --remove /dev/md0
sfdisk -d /dev/sda | sfdisk /dev/sdc
mdadm --add /dev/md1 /dev/sdc1
mdadm --add /dev/md2 /dev/sdc2
mdadm --add /dev/md3 /dev/sdc3

If I understand everything correctly, that was all I needed to do, since mdadm --detail now reports the drives to be actively synced.


You could do it the way you propose, but as Christian mentioned in the question comments, you can also just light up the existing drive as an existing RAID array and add another drive to it to re-establish redundancy. It all depends on whether you've got an existing system to play with, I guess, but if the existing disk has an OS on it, you can boot it (doing the grub dance might take a few minutes to work out, but it'll work).