Public bug reported:

When booting and the root filesystem is not found, initramfs runs any 
mountroot_fail hook scripts which have been registered. The mdadm 
mountroot_fail script tries to assemble arrays and if "mdadm  --incremental 
--run --scan" or "mdadm --assemble --scan --run" return successfully it returns 
with a 0 return value. This will cause the top level caller to exit any other 
failure hooks and try to mount root again. 

This seems good, but the mdadm executions will also return successfully
if they made no change to the situation. In my particular problem, the
kernel did not have access to the modules needed to see my hard drives.
Thus mdadm could not assemble them into the root device. However, since
the mountroot_fail function returned success (since mdadm had no
failures in assembling no devices) the initramfs continued to loop
forever trying to find root, running mountroot_fail in mdadm-functions,
repeat. It would never drop to am emergency shell so I could examine the
situation.

I did not discover my module issue until I added a check in the
mountroot_fail to see if the script had been run more than once. Below
is my code which I added before each "return 0" in the original script,
but it is not suitable as a real solution.

if [ -f /tmp/mdadm_loop ] ; then
  return 1
fi
touch /tmp/mdadm_loop
return 0


Below is required info based on reporting instructions.

# lsb_release -rd
Description:    Ubuntu 14.04 LTS
Release:        14.04

# apt-cache policy mdadm
mdadm:
  Installed: 3.2.5-5ubuntu4.1
  Candidate: 3.2.5-5ubuntu4.1
  Version table:
 *** 3.2.5-5ubuntu4.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 
Packages
        100 /var/lib/dpkg/status
     3.2.5-5ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

** Affects: mdadm (Ubuntu)
     Importance: Undecided
         Status: New

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

Title:
  mountroot_fail returns success when it has not changed the root found
  situation

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to