Replying to Gordon:
From looking at the bug reports, the core problem is that you want to have (during a transition period) two split mirrors on the one system. These are independant system images, the old and the new. If you boot from the 'old' device, you want the partitions on that device to be assembled in md0, md1,... as degraded arrays. When you boot from the 'new' device you want partitions from that device to become the mdX arrays.
This is a perfect example of where in-kernel autodetect won't work, as it cannot really know.
User-space would have a hard time 'knowing' too, but you could tell it.
One approach would be to
- use a different homehost name for the 'new' installation (it is just a string after all. Maybe $HOSTNAME-new
- Have some custom code in the initrd figure out which device was booted from and call "mdadm --autoassemble" with an appropriate homehost
Fundamentally this is a very special case scenario. The choice of which array to make /dev/md0 cannot be determined in a totally generic way. You need some special case code. The obvious place for that is in initrd. The new 'homehost' concept should make it fairly easy for that special-case code to tell mdadm what to do.
Does that seem reasonable?
