Bug 4537 - dracut doesn't include lvm command when /usr on lvm, / is not.
Summary: dracut doesn't include lvm command when /usr on lvm, / is not.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-16 05:38 CET by Dave Hodgins
Modified: 2012-03-07 15:56 CET (History)
2 users (show)

See Also:
Source RPM: dracut-015-3.mga2.src.rpm
CVE:
Status comment:


Attachments
Output of dracut --force --debug (137.19 KB, application/octet-stream)
2012-02-16 05:48 CET, Dave Hodgins
Details
/var/log/dracut.log from latest run (806 bytes, text/plain)
2012-02-16 05:51 CET, Dave Hodgins
Details
Output of git version of dracut (3.16 KB, text/plain)
2012-02-16 20:08 CET, Dave Hodgins
Details
Output of udevadm info command (1.95 KB, text/plain)
2012-02-17 00:43 CET, Dave Hodgins
Details

Description Dave Hodgins 2012-02-16 05:38:33 CET
As discussed on the developers mailing list, my system has / on
a physical partition, /usr on a lvm logical volume.

The latest dracut no longer includes the lvm command, or the dm_mod
kernel module.

Opening the bug report, to attach files to.
Comment 1 Dave Hodgins 2012-02-16 05:48:55 CET
Created attachment 1568 [details]
Output of dracut --force --debug

The / file system is on sda14.  The /usr filesystem is on the lvm
logical volume usr in the volume group 91 on sda12.  I.E. it's
device name is /dev/mapper/91-usr

Both filesystems are ext4.

File compressed to allow uploading.
Comment 2 Dave Hodgins 2012-02-16 05:51:09 CET
Created attachment 1569 [details]
/var/log/dracut.log from latest run
Comment 3 Colin Guthrie 2012-02-16 09:23:53 CET
Hmmm, you said on the list that you were using a mageia 1 chroot to generate the initrd?

I'm wondering if the udev info now used by dracut to determine if lvm is needed is simply not available under mga1... this will obviously cause problems on upgrades if this is the case.

I'll do a couple debugging patches shortly and ask you to send me the output (can be applied to an installed package so should be pretty easy :)

CC: (none) => mageia

Colin Guthrie 2012-02-16 09:24:11 CET

Status: NEW => ASSIGNED
Assignee: bugsquad => mageia

Comment 4 Colin Guthrie 2012-02-16 10:14:49 CET
Hi,

I've pushed a git repo to my personal git. Can you clone it and try it from there?

http://colin.guthr.ie/git/dracut/log/?h=mga-master-test

git clone git://colin.guthr.ie/dracut
git checkout -t origin/mga-master-test
sudo ./dracut -f foo.img -l -c /etc/dracut.conf --confdir /etc/dracut.conf.d

Then just post the output?

For reference, mine (not my test system, just my regular one) looks like this:

[colin@jimmy dracut (mga-master-test)]$ sudo ./dracut -f foo.img -l -c /etc/dracut.conf --confdir /etc/dracut.conf.d
AA: Checking MP '/'
AA: MP '/' IS a mount point
AA: Checking MP '/etc'
AA: Checking MP '/usr'
AA: Checking MP '/usr/bin'
AA: Checking MP '/usr/sbin'
AA: Checking MP '/usr/lib'
AA: Checking MP '/usr/lib64'
AA: Checking MP '/boot'
AA: MP '/boot' IS a mount point
BB: Checking '/dev/dm-0' ('/dev/dm-0|ext4' + '')
BB: Pushing fstype '/dev/dm-0|ext4'
BB: Checking '/dev/dm-0' ('/dev/block/252:0|ext4' + '/dev/dm-0|ext4')
BB: Pushing fstype '/dev/block/252:0|ext4'
BB: Checking '/dev/dm-0' ('/dev/block/8:1|LVM2_member' + '/dev/dm-0|ext4 /dev/block/252:0|ext4')
BB: Pushing fstype '/dev/block/8:1|LVM2_member'
BB: Checking '/dev/dm-0' ('/dev/block/8:0|' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member')
BB: Pushing fstype '/dev/block/8:0|'
BB: Checking '/dev/dm-0' ('/dev/block/8:1|LVM2_member' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member /dev/block/8:0|')
BB: Checking '/dev/dm-0' ('/dev/block/8:0|' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member /dev/block/8:0|')
BB: Checking '/dev/sda2' ('/dev/sda2|ext4' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member /dev/block/8:0|')
BB: Pushing fstype '/dev/sda2|ext4'
BB: Checking '/dev/sda2' ('/dev/block/8:2|ext4' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member /dev/block/8:0| /dev/sda2|ext4')
BB: Pushing fstype '/dev/block/8:2|ext4'
BB: Checking '/dev/sda2' ('/dev/block/8:0|' + '/dev/dm-0|ext4 /dev/block/252:0|ext4 /dev/block/8:1|LVM2_member /dev/block/8:0| /dev/sda2|ext4 /dev/block/8:2|ext4')
CC: Checking LVM status of '/dev/dm-0'
CC: '/dev/dm-0' is LVM
CC: Checking LVM status of '/dev/block/252:0'
CC: '/dev/block/252:0' is LVM
CC: Checking LVM status of '/dev/block/8:1'
CC: Checking LVM status of '/dev/block/8:0'
CC: Checking LVM status of '/dev/sda2'
CC: Checking LVM status of '/dev/block/8:2'
DD: LVM detected. Here is the cmdline config:
 rd.lvm.lv=solidstate/slash 

I: *** Including module: bootchart ***
I: *** Including module: dash ***
I: *** Including module: i18n ***
I: *** Including module: rpmversion ***
I: *** Including module: plymouth ***
I: *** Including module: dm ***
I: Skipping udev rule: 64-device-mapper.rules
I: *** Including module: kernel-modules ***
I: *** Including module: lvm ***
I: Skipping udev rule: 64-device-mapper.rules
I: *** Including module: resume ***
I: *** Including module: rootfs-block ***
I: *** Including module: terminfo ***
I: *** Including module: udev-rules ***
I: Skipping udev rule: 50-udev.rules
I: Skipping udev rule: 95-late.rules
I: Skipping udev rule: 50-firmware.rules
I: *** Including module: usrmount ***
I: *** Including module: base ***
I: *** Including module: fs-lib ***
I: *** Including module: shutdown ***
I: Skipping program kexec as it cannot be found and is flagged to be optional
I: *** Including modules done ***
I: Wrote /home/colin/Development/Personal/Mageia/core/dracut/SOURCES/dracut/foo.img:
I: -rw-r--r-- 1 root root 7689715 Feb 16 09:12 /home/colin/Development/Personal/Mageia/core/dracut/SOURCES/dracut/foo.img
Comment 5 Dave Hodgins 2012-02-16 20:08:48 CET
Created attachment 1578 [details]
Output of git version of dracut
Comment 6 Dave Hodgins 2012-02-16 20:26:34 CET
Looking at the code
# udevadm info --query=property --name=/dev/block/8:12
DEVNAME=/dev/sda12
DEVPATH=/devices/pci0000:00/0000:00:0f.0/host0/target0:0:0/0:0:0:0/block/sda/sda12
DEVTYPE=partition
MAJOR=8
MINOR=12
SUBSYSTEM=block
UDEV_LOG=3

The entry DM_VG_NAME is missing.
Comment 7 Dave Hodgins 2012-02-16 20:28:14 CET
# blkid /dev/block/8:12
/dev/block/8:12: UUID="ZfvIGX-Nb1m-Ncsa-q79Z-AQPJ-xiYU-dNRV1i" TYPE="LVM2_member"
Comment 8 Dave Hodgins 2012-02-16 20:39:38 CET
If I run the udevadm info command outside of the chroot, there is a lot
more info, including udevadm info, but still no DM_VG_NAME.
Comment 9 Dave Hodgins 2012-02-16 20:41:40 CET
Sorry copy/paste error, the including was supposed to be "ID_FS_TYPE=LVM2_member".
Comment 10 Colin Guthrie 2012-02-16 21:06:23 CET
Hmm, OK, so the problem seems to be with udev and I think I can forsee a problem here for upgrades....

As a test, can you modify module-setup.sh for the lvm module and force it to put the correct value into the cmdline.d file? (I did this to make a working initrd initially) Should be pretty obvious what you need to do.

When you boot with this, does the udevadmin info command work and give the necessary metadata?


Longer term, I think we'll need a better solution anyway as our mkinitrd started system on which any upgrade is performed will certainly not have any udev metadata and thus building an initrd will certainly fail... I'll have to ask Harald if he thinks we can do without udev here and use a different approach.
Comment 11 Dave Hodgins 2012-02-17 00:43:12 CET
Created attachment 1579 [details]
Output of udevadm info command

The info includes UDISKS_LVM2_PV_VG_NAME=91, but doesn't
have DM_VG_NAME or DM_LV_NAME

Note that due to bug 3385 the drive is hda again, instead of sda,
with the device major changed from 8 to 3.  I have to free up
some space before I can install todays kernel update, but will
update bug 3385 once I've done that.

In my opinion, when dracut is running in hostonly mode, the module
setup script for lvm should install lvm if the "type -P lvm" works
and blkid |grep -i 'TYPE="lvm' returns output, unless the user
selects --nolvmconf.

When not running in hostonly mode (i.e. live cd), lvm should always
be installed.

Inside the init script, if lvm has been included, the
"lvm vgchange -a y" command should be run before looking
for the root filesystem, rather then only if a filesystem
that's going to be mounted is on lvm.

Similar for raid.

That would simplify things, and ensure the partitions can always
be found.
Comment 12 Dave Hodgins 2012-02-18 20:43:49 CET
Sorry, the reference to bug 3385 should have been bug 3395.
Comment 13 Morgan Leijström 2012-02-24 10:44:38 CET
Is maybe bug 3375 related, if LVM partitions are mounted soon enough, so swap is not active for reading?

CC: (none) => fri

Comment 14 Colin Guthrie 2012-03-07 15:56:59 CET
The core issue with this bug is now fixed (LVM will be included in a hostonly initrd now for a /usr on LVM and / not) but LVM problems do still remain. These are all being tracked separately so I think I'll close this particular bug. If you disagree, please do reopen.

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


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