This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 460823 - /sbin/mkinitrd: line 368: cd: slaves: No such file or directory
/sbin/mkinitrd: line 368: cd: slaves: No such file or directory
Status: CLOSED DUPLICATE of bug 447841
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mkinitrd (Show other bugs)
5.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Jones
: Regression
Depends On: 439371
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-01 11:27 EDT by Zbysek MRAZ
Modified: 2013-07-03 09:08 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2008-0437
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-04 07:47:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zbysek MRAZ 2008-09-01 11:27:36 EDT
+++ This bug was initially created as a clone of Bug #439371 +++

Description of problem:
New installation of RHEL5.2-Server-20080326.0 on a s390x
system:
When creating initrd for installed kernel, mkinitrd stays
cycling in an infinite loop causing the whole installation
to fail.

=================================================================

Description of problem: mkinitrd writes error message, consumes all available CPU time and stucks while creating initramdisk image on x86_64 system

Version-Release number of selected component (if applicable):
mkinitrd-5.1.19.6-28 x86_64 together with i386 arch version

How reproducible:
upgrade kernel or manually try to create initramdisk

Steps to Reproduce:
1. mkinitrd /boot/kernel-2.6.18-92.test.img 2.6.18-92.el5
or
1. yum install kernel 
(I've tried the installation of kernel-2.6.18-92.1.10 from running kernel-2.6.18-92 as well as 2.6.18-91)
  
Actual results:
/sbin/mkinitrd: line 368: cd: slaves: No such file or directory

command did not create the initramdisk


Expected results:
exit in reasonable amount of time with 0 return code
Comment 1 Andy Harrison 2008-10-01 17:13:41 EDT

I ran into this bug while testing openvz which runs mkinitrd as part of its postinstall scriptlet.  The solution in bz 439371 doesn't solve the problem because there is nothing to handle a non-existent 'slaves' directory.

Similar to 439371, my directory layout is:

 $ find /sys/block/dm-0 /sys/block/dm-0/slaves/cciss\!c0d0p2/ | xargs ls --time-style "+" -Fogd
drwxr-xr-x 4    0  /sys/block/dm-0/
-r--r--r-- 1 4096  /sys/block/dm-0/dev
drwxr-xr-x 2    0  /sys/block/dm-0/holders/
-r--r--r-- 1 4096  /sys/block/dm-0/range
-r--r--r-- 1 4096  /sys/block/dm-0/removable
-r--r--r-- 1 4096  /sys/block/dm-0/size
drwxr-xr-x 2    0  /sys/block/dm-0/slaves/
lrwxrwxrwx 1    0  /sys/block/dm-0/slaves/cciss!c0d0p2 -> ../../../block/cciss!c0d0/cciss!c0d0p2/
drwxr-xr-x 3    0  /sys/block/dm-0/slaves/cciss!c0d0p2//
-r--r--r-- 1 4096  /sys/block/dm-0/slaves/cciss!c0d0p2/dev
drwxr-xr-x 2    0  /sys/block/dm-0/slaves/cciss!c0d0p2/holders/
lrwxrwxrwx 1    0  /sys/block/dm-0/slaves/cciss!c0d0p2/holders/dm-0 -> ../../../../block/dm-0/
-r--r--r-- 1 4096  /sys/block/dm-0/slaves/cciss!c0d0p2/size
-r--r--r-- 1 4096  /sys/block/dm-0/slaves/cciss!c0d0p2/start
-r--r--r-- 1 4096  /sys/block/dm-0/slaves/cciss!c0d0p2/stat
lrwxrwxrwx 1    0  /sys/block/dm-0/slaves/cciss!c0d0p2/subsystem -> ../../../block/
--w------- 1 4096  /sys/block/dm-0/slaves/cciss!c0d0p2/uevent
-r--r--r-- 1 4096  /sys/block/dm-0/stat
lrwxrwxrwx 1    0  /sys/block/dm-0/subsystem -> ../../block/
--w------- 1 4096  /sys/block/dm-0/uevent


Here is my proposed fix.


--- mkinitrd    2008-10-01 20:11:24.000000000 +0000
+++ mkinitrd    2008-10-01 20:38:20.000000000 +0000
@@ -365,6 +365,7 @@
     if echo $PWD | grep -q "/sys/block/dm-[[:digit:]]$"; then
         while [ ! -L device ]; do
             if [ -L subsystem ]; then
+                [ ! -d slaves ] && break
                 cd slaves
                        for x in *;do
                    if [ -L $x ]; then
Comment 2 Zbysek MRAZ 2008-11-04 07:47:12 EST

*** This bug has been marked as a duplicate of bug 447841 ***

Note You need to log in before you can comment on or make changes to this bug.