I recently installed mdadm an set up a raid1 configuration involving 2 500GIO drives.

Is there a way to backup a RAID configuration somewhere so I could re-load it using a single mdadm command in case I have to re-install my system ?

Let's say my system is installed on some ssd and for some reason I have to re-install it. The thing is, I have this already created RAID1 (Involving those two other disks) .. Is that possible to quickly bring back this RAID1 disk without having to go through all creation steps (wipe disks, create, sync, etc.). In other words, is the RAID lost or mdadm can recover an existing disk ?


If disks used in raid are the same (you do not replace any one of them), the only thing you need to do on newly installed system is to assemble your array with:

sudo mdadm --assemble --scan

and then "save" configuration:

sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf

This is needed for automatic array start when system boots up.


After you save the state of the array mentioned above, you shall update your initramfs with:

sudo update-initramfs -u
| improve this answer | |
  • @Vlastimil does your edit applies when the system isn't located on the RAID disk ? – Stphane Jul 26 '18 at 13:15
  • @Stphane Yes, it does. I, personally, update initramfs after each update to mdadm.conf. – LinuxSecurityFreak Jul 26 '18 at 13:27
  • @Stphane - even when the raid is "just storage" it is better to have it and not need it than need it and not have it. – ivanivan Jul 26 '18 at 13:52
  • sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf didn't work for me, but sudo -i followed by mdadm --detail --scan >> /etc/mdadm/mdadm.conf did. I imagine the sudo only applied to the first command and not the pipe into mdadm.conf? Might trip other newbies like me up too. – penitent_tangent Aug 24 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.