Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I will try to keep this short.

I have a mdadm RAID 6 with 11 drives. This has for years "just worked" across reinstalls and such, without any issues. I have not even had the need for configuring mdadm.conf.

After the 12.04 release, i can no longer boot the machine without mdadm failing to mount the array, and then throwing me into initramfs shell. Under boot, mdadm takes 7 of the drives and starts them in /dev/md127, of course that will fail.

When booted, i stop it, reassemble all drives as md0, and it is all good again.

The question is, how do i make it behave even during boot?

After quite some testing, my current mdadm.conf is this:

mdadm-status during boot:

Note that below on the paste above, is the command used for reassembly which works just fine.

Help? :)

share|improve this question

The problem is that the /usr/share/initramfs-tools/scripts/mdadm-functions is called before all drives has been initialized.

I have 6 drives in RAID array. 2 of them are onboard SATA and 4 are on mpt2sas (SAS2008) card.

Apparently mdadm tries to initialize the array before all 6 drives have been attached to the system

If I edit mdadm-functions to this everything works (ugly fix):

       sleep 15
   mdadm --misc --scan --detail --test >/dev/null 2>&1
   return $((! $?))

For me, this bug was introduced for when I upgraded from 10.04 LTS to 12.04.1 LTS Today!

share|improve this answer

So i figured out after some tips that the issue is that some drives is not dectected quickly enough by mdadm, so it simply stops up.

Somebody suggested adding rootdelay=30 as kernel parameter, but Ubuntu simply ignored that. Instead i added a initramfs premount script.

echo "sleep 60" > /etc/initramfs-tools/scripts/init-premount;
chmod +x /etc/initramfs-tools/scripts/init-premount;
update-initramfs -u;

And rebooted, the boot takes a minute longer but then i know that mdadm has dectected all drives.

share|improve this answer

Modification of answers found elsewhere that worked for me.

Symptoms I saw:

A RAID that ran fine under Lucid/10.04 stopped autoassembling when I upgraded to Precise/12.04. RAID was assembling as /dev/md127 in Precise. In initramfs shell the following fixed the problem and allowed the machine to boot.

mdadm --stop /dev/md127 mdadm --assemble /dev/md0

Solution that worked:

Make sure mdadm.conf has the correct ARRAY line. (The fact that I could assemble /dev/md0 correctly suggested mdadm.conf was correct.)

Create a script in /usr/share/initramfs-tools/scripts/local-top (I called it mdfix)

sleep 6
mdadm --stop /dev/md127
sleep 6
mdadm --assemble /dev/md0


chmod +x mdfix
update-initramfs -u

update-initramfs may generate a "no such device" about /dev/md127. Put your towel over your head and don't panic. :)

Reboot and you should get /dev/md0 mounting properly, if a little more slowly than before. (The sleeps may not be necessary, but better safe than sorry.)

share|improve this answer

You must log in to answer this question.

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