mdadm software RAID isn't assembled at boot during initramfs stage

Solution 1:

You could mirror the drives with btrfs itself, instead of creating that fs on top of the software raid: mkfs.btrfs -d raid1 /dev/sdc /dev/sdd

Otherwise try:

    umount /dev/md0 if mounted
    mdadm --stop /dev/md0
    mdadm --assemble --scan
    mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak
    /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf

If cat /proc/mdstat shows the correct output now then create your filesystem and mount it, use blkid to get the UUID for /dev/md0 and edit /etc/fstab accordingly.

If you are still having issues you could try this before proceeding with the above mentioned instructions:

    mdadm --zero-superblock /dev/sdc /dev/sdd
    mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1

I tested this on a system running Debian Jessie with 3.16.0-4-amd64 kernel, and I wrote gpt partition tables to the two block devices that I mirrored together. The array is properly assembled at boot and mounted as specified.