While you can create a MD-device on the fly and it will sync the disks, the trouble in your case is that RAIDs usually have a superblock on the devices in question and only serve the rest as a special device. Since the superblock usually (but not always) lies at the beginning of the underlying device, you'd have to move the file system (and even when the superblock is at the end of the device, you have to shrink the file system).
That said, mdadm
allows you to create a superblock-less RAID, but you should know what you are doing (for example you should ensure you always build the RAID with the same parameters) - see section "BUILD MODE" in man mdadm
.
Also note, that if you want to boot from the device, you either have to set up the RAID from the initrd
or make a pivot_root
later on "manually" (which is what initrd
scripts do at some point).