[Bug 942106] Re: software raid doesn't assemble before mount on boot

Erik Devriendt Erik.Devriendt at siemens.com
Tue Mar 26 20:44:59 UTC 2013


The patch of https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/942106/comments/5 does not work in following case:
- Ubuntu 12.04
- partitionable RAID-1 on two complete disks sda and sdb, giving array md0. Root partition is md0p1, swap partition is md0p2.
- One disk physically removed before boot.
- boot degraded arrays is requested

The system reports Mount failed, /dev/disk/my-uuid/<uniqueid> busy. 
This /dev/disk/my-uuid/<uniqueid> points to /dev/sda1.

Solution: 
add a second wait_for_udev at the end of the local-premount/mdadm script. 
This results in the script:
----------------
. /scripts/mdadm-functions
. /scripts/functions
 
wait_for_udev
degraded_arrays || exit 0
mountroot_fail || panic "Dropping to a shell."
wait_for_udev
-----------------

Hypothetical explanation:
mountroot_fail finds a degraded RAID-1 array and starts it with one disk, creating device /dev/md0. The function ends.
Next, the 'local' script tries to mount the root partition, but udev did not yet have time to detect the partitions and create the corresponding devices md0p1 and md0p1, and change the links in /dev/disk/by-uuid to these detected partitions.
The links in /dev/disk/by-uuid still point to /dev/sda[12], which are locked by  mdadm for md0.

The added wait_for_udev lets udev find the partitions md0p1 and md0p2 and change the links in /dev/disk/by-uuid before
trying to mount the root partition.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/942106

Title:
  software raid doesn't assemble before mount on boot

Status in “mdadm” package in Ubuntu:
  Fix Released
Status in “update-manager” package in Ubuntu:
  Fix Released
Status in “mdadm” source package in Precise:
  Fix Released
Status in “update-manager” source package in Precise:
  Fix Released
Status in “mdadm” source package in Quantal:
  Fix Released
Status in “update-manager” source package in Quantal:
  Fix Released

Bug description:
  [IMPACT]

   * Due to small time-outs udev may not detect all attached drives
  quick enough to be processed and assembled into a RAID array

  * This results in dropping a user into an initramfs shell or if
  BOOT_DEGRADED is set the boot will proceed degrading RAID unnecessary

   * The fix is to include wait_for_udev call to give udev more time to
  find the drives which are part of RAID

  [TESTCASE]

   * Install RAID preferably with a "slow" interface, e.g. RAID1 with
  one drive on external USB

  * Reboot multiple times and notice that sometimes boot fails

  * Upgrade to the -proposed package

  * Reboot multiple times and notice that boot fail less often

  [Regression Potential]

  * boot speed is decreased due to the nature of the fix, i.e. adding a physical delay
  * Multiple reports in this bug and on the ubuntuforums reporting that this change "fixes" the boot issue for the users

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/942106/+subscriptions




More information about the foundations-bugs mailing list