Consider creating a linear mode RAID with single disk(more disks may be added later).
#echo y | mdadm --create /dev/md0 --level=linear --raid-disk=1 /dev/sda1 --force
Now consider another partition is available , is it possible to "grow" from linear mode to RAID1(mirroring) mode? I can do something like this before for raid1 to raid5 , but for linear to RAID1 I have observed this error.
// change the level
echo raid1 > /sys/block/md0/md/level
"linear does not support online personality change"
I am aware about taking backup of existing contents of linear mode contents and then creating RAID1 with two partitions(one from span and another one newly added ) But, I am interested in doing it in place.
You can just re-create RAID with RAID-1 specifiyng only the first (active) disk first and using keyword "missing" for the 2nd.
mdadm
will give a warning, that this disk is already a part of array, of course, but you know what you're doing now. :-)Later then you can add that postponed disk and it'll get data copied from the first one, making the mirror complete.
P. S. In theory this operation isn't data destructive in a way, but as you've already said, you're aware of backuping. ;-)