Bug 517868 - mkinitrd copies lvm.conf verbatim inside the initrd without parsing it properly
mkinitrd copies lvm.conf verbatim inside the initrd without parsing it properly
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mkinitrd (Show other bugs)
All Linux
medium Severity medium
: rc
: 5.5
Assigned To: Peter Jones
Alexander Todorov
Depends On:
  Show dependency treegraph
Reported: 2009-08-17 11:38 EDT by Jon Thomas
Modified: 2010-11-24 00:35 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-03-30 05:00:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
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:

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
Comment 6 Peter Jones 2009-12-21 15:41:51 EST
This should be resolved in mkinitrd- .
Comment 8 Alexander Todorov 2010-01-06 09:04:34 EST
VERIFIED with mkinitrd-

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.


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