...
If the md device provides the file system including /boot or is an LVM PV (physical volume) then /etc/mdadm/mdadm.conf must be re-populated as shown below and the initramfs re-generated by:
update-initramfs -u
EFI System partition (ESP
EFI only recognizes FAT16/FAT32, so according to most sources, RAID 1 is not possible. However, that is not true: RAID 1 is possible as long as metadata version 0.9 or 1.0 is used. The reason it works is because metadata 0.9 or 1.0 is stored at the end of the partition, which doesn't interfere with EFI, whereas metadata 1.2 does since it's stored at the beginning.
To convert the EFI System partition device to md RAID ...
Back up the current ESP files and unmount: cd /boot && tar -cvzf efi.tar efi
umount /boot/efi
Create a RAID array: mdadm --create --metadata=1.0 --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 missing
"missing" allows you to specify that a second device isn't present yet .
Format the partition (you might need to install dosfsutils package first to get the command):
mkfs.vfat /dev/md1
Update /etc/fstab's /boot/efi line with the new file system's UUID:
blkid | grep md1
... and edit /etc/fstab, inserting the UUID into the /boot/efi line.
Restore the ESP files:
cd /boot && tar -xvzf efi.tar
Removal
For example:
mdadm --manage /dev/md2 --fail /dev/sd[ab]1
mdadm --manage /dev/md2 --remove /dev/sd[ab]1
mdadm --manage /dev/md2 --stop
mdadm --zero-superblock /dev/sd[ab]1
...