The short answer
Read the status without changing anything, image the disks, and do not run mdadm --create or a rebuild on the originals unless you know what it does.
Read, do not write
cat /proc/mdstat
sudo mdadm --detail /dev/md0
sudo mdadm --examine /dev/sd[a-z]1
smartctl -a /dev/sdXNote which disks are missing, their event counts and their SMART health. Save this output.
A degraded array is still running
If one disk of a mirror or RAID 5 dropped out, the array runs on the rest. Back up everything now, to another system. A rebuild puts heavy load on the remaining disks, and a second failing disk during a rebuild is how arrays are lost.
If it will not assemble
- Try
mdadm --assemble --scanand read the message. --forcecan assemble with an out-of-date member. It can also write in the wrong direction. Use it only after you have copies of the disks.
Never do this on the originals
mdadm --createon disks that hold data. It writes new metadata and can destroy the old layout.- Repeated reboots with a failing disk.
fsckon a broken array.
Copy the disks first
Copy each disk to an image with ddrescue, then work on the images or on the copies. A failing disk may only be readable once.
Remember
RAID is not a backup. It keeps a server running when a disk fails, and it copies your mistakes. Keep backups elsewhere. Hardware RAID cards have their own tools, so read their manual before you change anything.
Questions people ask
Can I replace a failed disk myself?
Yes, in a healthy mirror or RAID 5, by adding a new disk and letting it rebuild. Back up first, and check that the other disks are healthy.
Two disks failed. Is the data gone?
In RAID 5, often unrecoverable by normal means. A specialist may rescue part of it from images. Stop and ask for help.
Do you handle RAID recovery?
Yes for Linux software RAID and LVM: we copy the disks first and tell you what looks possible. We cannot recover physically damaged disks.