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

Bug #1334699 reported by Paul FitzPatrick
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
New
Undecided
Unassigned

Bug Description

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

Revision history for this message
vak (khamenya) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.