Ubuntu Freezes When Booting with Degraded Raid

I tried testing my software raid (mdadm) setup by removing one of the disks. When I tried to boot the degraded system, the system hanged displaying a purple screen. If I try booting the system in recovery mode, I get the following error:

** WARNING: There appears to be one or more degraded RAID devices ** The system my have suffered a hardware fault, such as a disk drive failure. The root device may depend on the RAID devices being online. Do you wish to start the degraded RAID? [y/N]:

** WARNING: There appears to be one or more degraded RAID devices **
The system my have suffered a hardware fault, such as a disk drive failure. The root device may depend on the RAID devices being online.
Do you wish to start the degraded RAID? [y/N]:


If I press “y”, the system boots fine (apart from the degraded raid of course :-)). If I press “N” I’m presented with a busybox rescue shell from the initramfs which should allow me to “fix” this situation. Exiting the shell, resumes the boot service.

Why can I boot the system in recovery without actually doing anything while the normal boot hangs? As it turns out, the normal boot doesn’t hang at all. Due to a bug dating at least to Ubuntu 11.10, the purple splash screen actually hides the prompt asking whether to boot. After a few seconds, the prompts times-out, which is the same as if answered “N”, so it brings up the initramfs rescue shell (which is still hidden). Blindly typing “exit” (and <enter>) will exit the initramfs shell and resume normal boot.

A more permanent workaround is to add “bootdegraded=true” to the default kernel options. This will cause the kernel to always boot regardless of degraded raid arrays. Just make sure you have a proper why to notify you of the health of the raid array once the system boots.

References:
System won’t boot unless I type “exit” at initramfs prompt
disks not ready in array causes mdadm to force initramfs shell

3 thoughts on “Ubuntu Freezes When Booting with Degraded Raid

  1. Guy Post author

    Actually the screenshot is of a virtual machine. VirtualBox has a command to take a screenshot:

    $VBoxManage controlvm "Machine Name" screenshotpng ~/image-`date +%s`.png
    
  2. Pingback: Linux Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *