6

I have an Ubuntu (9.10) machine with 4 SATA disks. Each disk is partitioned identically, with the first few gigabytes set aside for a RAID 1 array (/dev/md0) for the boot volume, and the remainder set aside for RAID 5 (/dev/md1).

Recently, I upgraded to larger drives by repeatedly failing and removing a drive, replacing it with the larger one, partitioning it, and rebuilding onto it, per the instructions here. This all completed successfully.

However, the first time I reboot after upgrading, Ubuntu kicks me out to an initfs shell, claiming it can't find the root device. On checking /proc/mdstat, I discover that it's somehow assembled the entire drives (/dev/sda, /dev/sdb etc) into a single RAID 5 volume under /dev/md1, instead of assembling the partitions into their own arrays. Doing mdadm --stop /dev/md1; mdadm --assemble --scan fixes it, and both volumes are assembled correctly (and mount without issues).

What's going wrong, and how can I fix it?

1 Answer 1

2

Make sure you have /etc/mdadm.conf with proper configuration for your array. Even though Linux kernel can detect and assemble mdadm arrays automatically, sometimes it does funny things. Having /etc/mdadm.conf eliminates the uncertainty. Here is how mine looks like:

DEVICE  /dev/sdb /dev/sdc
ARRAY   /dev/md0 metadata=0.90 UUID=b8fdfd55:524cecb2:2d164f4f:84bee133

The ARRAY line comes from output of this command:

mdadm --examine --scan

Hope this helps.

3
  • Since it's halting in the initrd, I presume this isn't going to be able to read the updates if I just modify the files. Is there something I can do to have the updated mdadm.conf reflected in the initrd, other than editing it by hand? Jun 5, 2011 at 11:53
  • Doing as you suggested (only the devices line needed updating) worked, after running sudo update-initramfs -u. Thanks! Jun 5, 2011 at 12:01
  • Good job. I haven't been using it with boot devices, so you taught me something new :-)
    – dtoubelis
    Sep 27, 2011 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .