The CentOS6/RHEL6 installer does not allow to put the efi partition (/boot/efi) on a md device. And there is a pretty good reason for that:
The UEFI firmwares does only recognize FAT12/16/32 filesystems! In this early boot state, the md device is not available.
If you try it anyway (CentOS6), you will get an error, saying "You have not created a /boot/efi partition", like this:
As you can see above, I've defined an efi partition on the raid1 md device /dev/md3. Ignoring this fact, the installer continues to reject the creation of the partition layout. And that's kind of correct, since the default md superblock format is v1.2 in current versions of mdadm.
The location of the md-superblock on the disc matters!
In version 1.2, the metadata are located at the beginning of the device, with a offset of 4kb. That's the reason why the UEFI firmwares are not able to recognize the partition as valid efi partition.
... whats about version 1.0???!!!!??? ... Oh Yeah ... the superblock is located at the end of the device. In that case the two raid members itselves, are valid FAT partitions.
Now you are only a few steps away from raid1 mirroring your efi partition! ... Keep on reading.
1. Go without a mirrored efi-partition at installation time.
Just create two partitions of the same size (~200M) and configure one to be the the efi partition.
2. Finish the installation.
3. Backup the content of the efi-partition.
# cd /boot # tar -cvzf efi.tar.gz efi
4. Unmount the efi partition.
# umount /boot/efi
5. Create the new raid1.
Use a free md-name (md3 in my case) and the two partitions, created in step 1 (/dev/sda1 and /dev/sda2 in my case).
# mdadm --create --metadata=1.0 --verbose /dev/md3 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1
6. Create a FAT filesystem on the new raid1.
# mkfs.vfat /dev/md3
7. Mount the newly created efi partition.
You have to get the uuid of the new md device and replace the old one in the file /etc/fstab.
# ls -l /dev/disk/by-uuid/ | grep md3 lrwxrwxrwx. 1 root root 11 Mar 18 18:50 84F7-D615 -> ../../md3
mount and verify:
# mount -a # mount | grep efi /dev/md3 on /boot/efi type vfat (rw,umask=0077,shortname=winnt)
8. Restore the content of the old efi partition to the new md device.
# cd /boot # tar -xvzf efi.tar.gz
In case of anything goes wrong, you should have a rescue cd prepared.