Bug 517868

Summary: mkinitrd copies lvm.conf verbatim inside the initrd without parsing it properly
Product: Red Hat Enterprise Linux 5 Reporter: Jon Thomas <jthomas>
Component: mkinitrdAssignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Alexander Todorov <atodorov>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: atodorov, borgan, bubrown, ddumas, tao
Target Milestone: rc   
Target Release: 5.5   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 5.1.19.6-56 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 05:00:21 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jon Thomas 2009-08-17 11:38:50 EDT
Description of problem:


RHEL5 will no longer boot, because it will not be able to activate the root VG/LV, if lvm is configured to use host tags with the configuration below inside /etc/lvm/lvm.conf

tags { host_tags = 1 }

The problem happens because mkinitrd copies lvm.conf verbatim inside the initrd without parsing it properly. tags { host_tags = 1 } is not suitable inside initrd time even because hostname is not set.


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

rhel 5.3

How reproducible:

with lvm

Steps to Reproduce:

  
1- Pick a pristine RHEL5 machine recently installed with a root filesystem on LVM

2- insert the configuration onto lvm.conf

tags { host_tags = 1 }

3- create the file /etc/lvm/lvm_`hostname`.conf and add the activation entries in there:

activation { volume_list=[ "VolGroup00", "@myhostname.localdomain"] }

4- Rebuild initrd

mkinitrd -f /boot/initrd-`uname -r`.img `uname -r`

5- Reboot with new initrd

6- Notice a kernel panic because root vg was not activated.

Actual results:

kernel panic because root vg was not activated.
Expected results:
normal boot

Additional info:


A few options are available.

    1- creating an lvm.conf from lvm dumpconfig

lvm dumpconfig > initrd/etc/lvm/lvm.conf

    2- Another option is to use lvm dumpconfig and cherry pick what is more suitable.

lvm dumpconfig global > initrd/lvm/lvm.conf

    3- Another option entirely is to bypass having lvm.conf inside the initrd/init and doing:

# lvm vgscan --config 'devices{ filter = [ "a/mapper/", "r/.*/" ] }'
       # lvm vgchange -ay  VolGroup00 --config 'devices{ filter = [ "a/mapper/", "r/.*/" ] }'

This is similar to what is done in the article below:

http://kbase.redhat.com/faq/docs/DOC-10146
Comment 2 Peter Jones 2009-08-18 10:13:33 EDT
This looks good to me.
Comment 3 RHEL Product and Program Management 2009-09-25 13:43:49 EDT
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 6 Peter Jones 2009-12-21 15:41:51 EST
This should be resolved in mkinitrd-5.1.19.6-56 .
Comment 8 Alexander Todorov 2010-01-06 09:04:34 EST
VERIFIED with mkinitrd-5.1.19.6-56


lvm.conf has:
tags { hosttags = 1 }

lvm_dhcp70-248.rhts.bos.redhat.com.conf has:

activation { volume_list=["VolGroup00", "@dhcp70-248.rhts.bos.redhat.com"]}


After running mkinitrd the system was able to boot into runlevel 3 without a kernel panic.
Comment 10 errata-xmlrpc 2010-03-30 05:00:21 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0295.html