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?

Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
Nick Johnson
  • 364
  • 1
  • 10

1 Answers1

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.

dtoubelis
  • 4,677
  • 1
  • 29
  • 32
  • 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? – Nick Johnson Jun 05 '11 at 11:53
  • Doing as you suggested (only the devices line needed updating) worked, after running `sudo update-initramfs -u`. Thanks! – Nick Johnson Jun 05 '11 at 12:01
  • Good job. I haven't been using it with boot devices, so you taught me something new :-) – dtoubelis Sep 27 '11 at 00:52