[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#317285: initrd-tools: mkinitrd infinite recursion f RAID component device file missing

Package: initrd-tools
Severity: normal

In trying to perform a new sarge install onto a multi-disk RAID array,
I ran into a problem which caused the install to hang when installing
the kernel package.  Investigation revealed that the
/usr/sbin/mkinitrd script was falling into infinite recursion and
eventually failing.

The core cause of this was that my RAID array involved a partition on
the 9th IDE device position (hdi).  The block devices for hdi were not
present in the /dev of the installation target.  This apparently
caused "mdadm -D" (which is invoked in the function getraid_mdadm) to
output lines for some partitions without a device file.  Something
like this (not the real output):

    Number   Major   Minor   RaidDevice State
       0       3        1        0      active sync   /dev/hda1
       1      22        1        1      active sync

The awk script in the getraid_mdadm function assumes that the final
field of these lines will always be a device file.  In my case (where
the device file was missing), it added the word "sync" to the devices
variable.  This caused the getroot function to be invoked with "sync"
as its argument.  Because getroot was given a single argument which
was not a block device, this code got executed:

		# Assume label or UUID.
		eval "$(
			awk 'NR > 2 { printf "getroot -s %d %d\n", $1, $2 }' \

This generated multiple calls to getroot, one of which had major
number 9, so it called getraid_mdadm again.  Thus, it recursed
infinitely.  During this, the shell process ran out of file
descriptors, but continued for some time after that.  It eventually
failed, but took more than an hour to do so.

I avoided this problem for my installation purposes by moving my disk
from hdi to hda.  This made the device node for the partition present
in the filesystem (which included hda-hdh but not hdi), which made the
output of "mdadm -D" include a device file, which avoided the "getroot
sync" call, and allowed mkinitrd to complete.

--Ken Schalk <ken at xorian dot net>

P.S. There's a separate problem here in that the installation
filesystem was missing /dev/hdi* when I was clearly using it, but I'm
not sure which package to file that bug against.  Could someone point
me in the right direction?

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages initrd-tools depends on:
ii  coreutils [fileutils]         5.2.1-2    The GNU core utilities
ii  cpio                          2.5-1.2    GNU cpio -- a program to manage ar
ii  cramfsprogs                   1.1-6      Tools for CramFs (Compressed ROM F
ii  dash                          0.5.2-5    The Debian Almquist Shell
ii  util-linux                    2.12p-4    Miscellaneous system utilities

-- no debconf information

Reply to: