Where do md array definitions come from?

Solution 1:

It is highly different on different systems. The linux software raid uses a raid superbock, which is on the last 64kB of the each of the member devices.

More exactly, if the size of the device is n byte, the raid superblock is at n&~65535-65536.

The raid superblock is on the end, because in mirror-like raid levels it makes easier to use a member device independently from the array (because you can simply mount it, of course you need to do an array recover after that).

Its exact raid superblock format is described detailed in this wiki.

Its actual byte data you can view/edit by any hexa editor, for example dhex.

Practically, it describes the whole raid layout (raid level, checksum), and that which is the member device in the whole array.

During the raid initialization, the kernel reads the superblocks and examines their consistency. Insonsistent members aren't inserted into the array.

mdadm --examine --scan shows exactly this raid superblock information, without the intervention of the kernel raid driver.

In your case, there is a clear inconsistency in your array. From here it can't be easily found, what is its cause. But, you have a raid1, which is a mirror, so there is no real danger of a data loss. The easiest what you can do:

  1. You destroy the raid superblock on one of the raid members with an mdadm --zero-superblock command,
  2. And then re-insert this device to the array with an mdadm --add.

It will start a new resync.

P.s.#1:

I think the raid superblock was already rewritten by your ubuntu, but it is not sure. Zeroing the superblock and then reinserting the device will fix it.

P.s.#2:

The raid superblock format is platform-independent, it should be the same until the last byte between different architectures, even in the case of an endianness incompatibility. Your problem is nearly surely not architectural incompatibility, but a mistaken overwrite of the raid superblock on one of your devices.

Solution 2:

The metadata is stored in the superblock.

To delete, I think you want to look at mdadm --zero-superblock. Make sure you have a backup of the metadata before you start fiddling.