Comment 3 for bug 136252

Revision history for this message
Jason Chrispens (jason-chrispens) wrote : Re: [gutsy] mdadm, initramfs missing ARRAY lines

I had a similar problem when attempting to move my root filesystem onto a RAID-1 configuration.

mdadm wouldn't assmble the array while the initramfs was mounted, but would when the normal root filesystem was mounted.

My mdadm.conf looks to be similar to those described, with a "DEVICE partitions" line.

However, after a bit research, I think that my problem was with the "HOMEHOST <system>" line.

mdadm uses HOMEHOST to determine which partitions to automatically assemble into arrays. When HOMEHOST is set to '<system>' mdadm uses the hostname of the system.

Unfortunately, the initramfs file system doesn't set a hostname (i.e. the hostname of the system in initramfs is '(none)'), which doesn't match the homehost of the partitions in the array, which causes mdadm to not automatically assemble any arrays.
(The first 64 bits of the SHA1 hash of homehost appears to be the last 64 bits of the array's UUID.)

Explicitly naming the arrays using ARRAY lines in mdadm.conf causes mdadm to assemble those arrays without using homehost Alternatively, I set HOMEHOST in mdadm.conf to match the hostname of the system.

I don't know enough about things to say what a general solution is, but hopefully this explains the inconsistent behavior between the initramfs image and the normal root filesystem.