How can I migrate soft RAID array made by mdadm to new server and new OS?

I have a RAID array which level is raid0 and made by mdadm, in my old server. The member of this array is 6 NVMe SSD, and I create this array with below command:

sudo mdadm -C /dev/md0 -l 0 -n 6 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1

Last week my old server OS disk (not this array) was broken. Since old server's IPMI have some hardware problem, I install a new OS in a new server, and plugin my all 6 NVMe SSD on new server. After reboot server, I found device /dev/dm0 is not exist. Then I tried execute below command:

~$ sudo mdadm --assemble --scan
mdadm: No arrays found in config file or automatically

I wonder how can I find my soft RAID disk?


Solution 1:

Make shure that all drives are here (lsscsi or nvme list). After that you can manually assemble the array:

sudo mdadm --assemble /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1

Than add save the configuration:

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