Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 457216

Summary: mkinitrd bugs when multipath is activate for boot on SAN
Product: Red Hat Enterprise Linux 5 Reporter: Jean-Francois Lassignardie <jean.francois.lassignardie>
Component: mkinitrdAssignee: Peter Jones <pjones>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: abultman, atodorov, mpoole, tao
Target Milestone: rcKeywords: OtherQA
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-24 16:12:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jean-Francois Lassignardie 2008-07-30 09:57:00 UTC
Description of problem:

In the script mkinitrd, the variable rootdev is overwritten when the multipath
is activated that leads to have the wrong rootdev to create the line  "mkrootdev
-t ext3 -o defaults,ro /dev/sdc" instead of mkrootdev -t ext3 -o defaults,ro
/dev/VolGroup00/LogVol01"

In the mkinitrd line 1135

       if [ "${withmpath}" -eq "1" ]; then
           for rootdev in ${rootdevs} ; do     <==  Overwrite the rootdev variable
               disk=$(find_dm_in_sysblock ${rootdev} | sed -e 's,^/sys,,') 
               wwid=$(/sbin/scsi_id -g -u -s ${disk})
               if [ -z "${wwid}" ]; then
                   # Could be EMC unit requiring special option
                   wwid=$(/sbin/scsi_id -g -ppre-spc3-83 -u -s ${disk})
               fi
               if [ -n "${wwid}" ]; then
                   case " ${root_wwids} " in
                       *" ${wwid} "*) continue ;;
                       *) root_wwids="${root_wwids} ${wwid}" ;;
                   esac
               fi
           done
           if [ -n "$root_wwids" ]; then
               use_multipath=1
           fi
       fi


Version-Release number of selected component (if applicable):

mkinitrd-5.1.19.6-28

How reproducible:

when multipath is activated for boot on SAN

Steps to Reproduce:
1.

~/mkinitrd -f initrd-2.6.18-92.1.6.el5.img 2.6.18-92.1.6.el5
  
Actual results:
The system can't boot with the initrd generated by this script

Expected results:

Boot the system on SAN with the correct initrd

Additional info:

In the mkinitrd line 1135
rename the variable rootdev by rootdev1 in the following line solve this problem

       if [ "${withmpath}" -eq "1" ]; then
           for rootdev1 in ${rootdevs} ; do     <==  Overwrite the rootdev variable
               disk=$(find_dm_in_sysblock ${rootdev1} | sed -e 's,^/sys,,') 
               wwid=$(/sbin/scsi_id -g -u -s ${disk})
               if [ -z "${wwid}" ]; then
                   # Could be EMC unit requiring special option
                   wwid=$(/sbin/scsi_id -g -ppre-spc3-83 -u -s ${disk})
               fi
               if [ -n "${wwid}" ]; then
                   case " ${root_wwids} " in
                       *" ${wwid} "*) continue ;;
                       *) root_wwids="${root_wwids} ${wwid}" ;;
                   esac
               fi
           done
           if [ -n "$root_wwids" ]; then
               use_multipath=1
           fi
       fi

Comment 1 Adam 2010-02-25 18:51:10 UTC
Confirmed this in RHEL 5.3 (Tikanga).  My system here is doing the same thing; each time I run mkinitrd on my system it sets the "mkrootdev..." line to use sd[a|b|c|d] instead of the correct MPATH variable.  The 'resume' line gets set properly with the multipath listed, but not the mkrootdev line.

Making the simple change that Jean-Francois in the mkinitrd script causes mkinitrd to create an initrd file with the correct 'mkrootdev...' line in it using the multipathed root.

Comment 2 RHEL Program Management 2010-07-02 03:29:11 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Alexander Todorov 2010-07-13 13:51:41 UTC
Jean and Adam,
Red Hat QE may not be able to test this particular setup. Are you willing to test if this feature is fixed and provide feedback during RHEL 5.6 test campaign (i.e. when we release a Beta or a snapshot)?

Comment 4 Jean-Francois Lassignardie 2010-07-13 13:56:23 UTC
It is OK for me

Comment 5 Peter Jones 2010-09-24 16:12:17 UTC

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