Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dracut cannot find lvm module?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mathfeel
l33t
l33t


Joined: 03 Aug 2004
Posts: 700

PostPosted: Sat Jun 09, 2012 10:09 am    Post subject: dracut cannot find lvm module? Reply with quote

Got this error when running dracut to produces an initramfs:
Code:
# dracut -H -f '' 3.3.4-ck
E: Dracut module "lvm" cannot be found.
E: Dracut module "lvm" cannot be found.
I: *** Including module: dash ***
I: *** Including module: caps ***
I: *** Including module: i18n ***
I: *** Including module: kernel-modules ***
I: *** Including module: fstab-sys ***
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 /boot/initramfs-3.3.4-ck.img:
I: -rw-r--r-- 1 root root 4320001 Jun  9 03:03 /boot/initramfs-3.3.4-ck.img


When dracut is installed with DRACUT_MODULES lvm:
Code:
# emerge -pv dracut

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-kernel/dracut-018-r1  USE="device-mapper net -debug (-selinux)" DRACUT_MODULES="caps crypt lvm ssh-client syslog -biosdevname -bootchart -btrfs -crypt-gpg -dmraid -dmsquash-live -gensplash -iscsi -livenet -mdraid -multipath -nbd -nfs -plymouth" 185 kB

Total: 1 package (1 reinstall), Size of downloads: 185 kB


Any idea?
_________________
-----------------------------------------------------------
"In heaven all the interesting people are missing"
-- Friedrich Nietzsche
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Sun Jun 24, 2012 11:31 am    Post subject: Reply with quote

I get the exactly same problem just now.
I have rebooted, the newly created initrd is loaded, but then shows just a lot of exception message.
STFW then I entered this thread...

Code:
fpemud-workstation / # dracut -f -H --lzma -a "lvm" /boot/initramfs-dracut-x86_64-3.2.12-gentoo
E: Dracut module "lvm" cannot be found.
E: Dracut module "lvm" cannot be found.
I: *** Including module: dash ***
I: *** Including module: i18n ***
I: *** Including module: plymouth ***
I: *** Including module: kernel-modules ***
W: Possible missing firmware "aic94xx-seq.fw" for kernel module "aic94xx.ko"
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: *** 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 /boot/initramfs-dracut-x86_64-3.2.12-gentoo:
I: -rw-r--r-- 1 root root 4119540 Jun 24 19:42 /boot/initramfs-dracut-x86_64-3.2.12-gentoo


Content in "/etc/dracut" is totally unchanged.

Code:
fpemud-workstation ~ # dracut --list-modules
dash
i18n
convertfs
plymouth
dm
kernel-modules
lvm                                       // so lvm is recognized by dracut
fstab-sys
resume
rootfs-block
terminfo
udev-rules
virtfs
securityfs
pollcdrom
usrmount
base
fs-lib
img-lib
shutdown


Code:
fpemud-workstation / # equery uses dracut
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-kernel/dracut-019:
 U I
 - - debug                        : Module installing additional tools like strace, file editor, ssh and more
 + + device-mapper                : Set of helper modules providing support for device mapper. You need to enable this only if emerge says so.
 - - dracut_modules_biosdevname   : Name devices with names returned by BIOS
 - - dracut_modules_bootchart     : Measure performance of the boot process for later visualisation
 - - dracut_modules_btrfs         : Scan for Btrfs on block devices
 - - dracut_modules_caps          : Load kernel modules and drop this privilege for real init
 - - dracut_modules_crypt         : Decrypt devices encrypted with cryptsetup/LUKS
 - - dracut_modules_crypt-gpg     : Support for GPG-encrypted keys for crypt module
 - - dracut_modules_dmraid        : Support dmraid devices, also known as ATA-RAID, or Fake RAID
 - - dracut_modules_dmsquash-live : Module which might be used for Live CDs
 - - dracut_modules_gensplash     : Framebuffer splash (media-gfx/splashutils)
 - - dracut_modules_iscsi         : Support iSCSI
 - - dracut_modules_livenet       : Similar to dmsquash-live but gets image via HTTP(S)
 + + dracut_modules_lvm           : Support Logical Volume Manager
 - - dracut_modules_mdraid        : Support MD devices, also known as software RAID devices
 - - dracut_modules_multipath     : Support Device Mapper multipathing
 - - dracut_modules_nbd           : Support network block devices
 - - dracut_modules_nfs           : Support NFS
 + + dracut_modules_plymouth      : Plymouth boot splash
 - - dracut_modules_ssh-client    : Install ssh and scp along with config files and specified keys
 - - dracut_modules_syslog        : Enable logging with syslog-ng or rsyslog
 - - net                          : Set of helper modules providing networking support. You need to enable this only if emerge says so.
Back to top
View user's profile Send private message
MotivatedTea
Apprentice
Apprentice


Joined: 06 Nov 2006
Posts: 269
Location: Toronto, Canada

PostPosted: Mon Jun 25, 2012 1:10 am    Post subject: Reply with quote

I just started using dracut, so I'm no expert, but I didn't run into this problem. Did you remember to re-emerge lvm2 with the "static" USE flag?
Back to top
View user's profile Send private message
kiboko
n00b
n00b


Joined: 29 May 2003
Posts: 59

PostPosted: Mon Jun 25, 2012 5:05 pm    Post subject: Reply with quote

I am getting the same problem with mdraid where it was working correctly a few weeks ago but now gives
Code:
E: Dracut module "mdraid" cannot be found.


Dracut log from today
Code:

=== Mon Jun 25 11:03:10 MDT 2012 ===

D: Executing /usr/bin/dracut -H -a mdraid -f  3.4.4-gentoo
E: Dracut module "mdraid" cannot be found.
E: Dracut module "mdraid" cannot be found.
E: Dracut module "mdraid" cannot be found.
E: Dracut module "mdraid" cannot be found.
I: *** Including module: dash ***
D: Installing /lib64/libc-2.14.1.so
D: Installing /lib64/ld-2.14.1.so
D: Installing /bin/dash
...


Dracut log from a couple of weeks ago
Code:
=== Wed Jun  6 13:30:34 MDT 2012 ===

D: Executing /usr/bin/dracut --force  3.3.4-gentoo
I: *** Including module: dash ***
D: Installing /lib64/libc-2.14.1.so
D: Installing /lib64/ld-2.14.1.so
D: Installing /bin/dash
...


Unable to figure out what has changed since them beyond updating dracut.
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Sat Jul 07, 2012 1:18 pm    Post subject: Reply with quote

Thanks MotivatedTea.

yeah, the static use flag is enabled:
Code:
fpemud-workstation fpemud # equery uses lvm2
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-fs/lvm2-2.02.88:
 U I
 - - lvm1        : Allow users to build lvm2 with lvm1 support
 + + readline    : Enables support for libreadline, a GNU line-editing library that almost everyone wants
 + + static      : !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically
 + + static-libs : Build static libraries


And I found a bug here which excatly described my problem.
I seems gentoo lacks some udev rules.
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Sat Jul 07, 2012 2:09 pm    Post subject: Reply with quote

In the bug above there's some info, now it seems the 11-dm-lvm.rules does not take effect, some property is not set.

In line 18 of file /lib/udev/rules.d/11-dm-lvm.rules:
Code:
ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"


I think it's strange, UUID is a string of hex code, so how can it be prefixed with "LVM-", so the script will definitely goto "lvm_end" after this line?

my lvm2 version:
Code:
fpemud-workstation rules.d # equery belongs 11-dm-lvm.rules
 * Searching for 11-dm-lvm.rules ...
sys-fs/lvm2-2.02.88 (/lib/udev/rules.d/11-dm-lvm.rules)
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Sun Jul 08, 2012 3:39 am    Post subject: Reply with quote

I read /lib/udev/rules.d/10-dm.rules:

The content of Line 129 - Line 133:
Code:
LABEL="dm_disable"
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="1"
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
OPTIONS:="nowatch"


The vg0-root partition's info has this 3 disable flag:
Code:
fpemud-workstation fpemud # udevadm info --query=all -n /dev/mapper/vg0-root
P: /devices/virtual/block/dm-1
N: dm-1
S: root
E: UDEV_LOG=3
E: DEVPATH=/devices/virtual/block/dm-1
E: MAJOR=253
E: MINOR=1
E: DEVNAME=/dev/dm-1
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: DM_SBIN_PATH=/sbin
E: DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1
E: DM_UDEV_DISABLE_DISK_RULES_FLAG=1
E: DM_UDEV_DISABLE_OTHER_RULES_FLAG=1
E: DEVLINKS=/dev/root


So I think the dm_disable procedure is called abnormally. I guess it is due to line 72 in 10-dm.rules:
Code:

# Normally, we operate on "change" events. But when coldplugging, there's an
# "add" event present. We have to recognize this and do our actions in this
# particular situation, too. Also, we don't want the nodes to be created
# prematurely on "add" events while not coldplugging. We check
# DM_UDEV_PRIMARY_SOURCE_FLAG to see if the device was activated correctly
# before and if not, we ignore the "add" event totally. This way we can support
# udev triggers generating "add" events (e.g. "udevadm trigger --action=add" or
# "echo add > /sys/block/<dm_device>/uevent"). The trigger with "add" event is
# also used at boot to reevaluate udev rules for all existing devices activated
# before (e.g. in initrd). If udev is used in initrd, we require the udev init
# script to not remove the existing udev database so we can reuse the information
# stored at the time of device activation in the initrd.
ACTION=="add", ENV{DM_UDEV_RULES_VSN}!="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable"
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Sun Jul 08, 2012 4:13 am    Post subject: Reply with quote

the result "udevadm test" successfully created the DM_NAME and DM_UUID.
perhaps there's bug in openrc? so these value did not created at startup?

Code:
fpemud-workstation fpemud # udevadm test --action=change  /devices/virtual/block/dm-1
run_command: calling: test
udevadm_test: version 171
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/10-dm.rules' as rules file
parse_file: reading '/run/udev/rules.d/10-root-link.rules' as rules file
parse_file: reading '/lib/udev/rules.d/11-dm-lvm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/13-dm-disk.rules' as rules file
parse_file: reading '/lib/udev/rules.d/30-kernel-compat.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-gentoo.rules' as rules file
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-floppy.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/65-kvm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/69-cd-sensors.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-libgphoto2.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-udev-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/77-nm-olpc-mesh.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-rfkill.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-uam.rules' as rules file
parse_file: reading '/lib/udev/rules.d/90-alsa-restore.rules' as rules file
parse_file: reading '/lib/udev/rules.d/90-network.rules' as rules file
parse_file: reading '/lib/udev/rules.d/90-pulseaudio.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-cd-devices.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-dm-notify.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-dell.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-gateway.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-ibm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-csr.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-hid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-upower-wup.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-fuse.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-ntfs3g.rules' as rules file
udev_rules_new: rules use 104040 bytes tokens (8670 * 12 bytes), 23698 bytes buffer
udev_rules_new: temporary index used 37780 bytes (1889 * 20 bytes)
udev_device_new_from_syspath: device 0xa42170 has devpath '/devices/virtual/block/dm-1'
udev_device_new_from_syspath: device 0xa51930 has devpath '/devices/virtual/block/dm-1'
udev_device_read_db: device 0xa51930 filled with db file data
udev_rules_apply_to_event: LINK 'mapper/vg0-root' /lib/udev/rules.d/10-dm.rules:114
udev_rules_apply_to_event: LINK 'root' /run/udev/rules.d/10-root-link.rules:3
udev_rules_apply_to_event: IMPORT '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root' /lib/udev/rules.d/11-dm-lvm.rules:21
udev_event_spawn: starting '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root'
spawn_read: '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root'(out) 'DM_VG_NAME='vg0''
spawn_read: '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root'(out) 'DM_LV_NAME='root''
spawn_read: '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root'(out) 'DM_LV_LAYER='''
spawn_wait: '/sbin/dmsetup splitname --nameprefixes --noheadings --rows vg0-root' [27298] exit with return code 0
udev_rules_apply_to_event: GROUP 6 /lib/udev/rules.d/50-udev-default.rules:68
udev_event_execute_rules: no node name set, will use kernel supplied name 'dm-1'
udev_node_add: creating device node '/dev/dm-1', devnum=253:1, mode=0660, uid=0, gid=6
udev_node_mknod: preserve file '/dev/dm-1', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/dm-1, 060660, uid=0, gid=6
node_symlink: preserve already existing symlink '/dev/block/253:1' to '../dm-1'
link_update: creating link '/dev/mapper/vg0-root' to '/dev/dm-1'
node_symlink: found existing node instead of symlink '/dev/mapper/vg0-root'
node_symlink: replace device node '/dev/mapper/vg0-root' with symlink to our node '/dev/dm-1'
node_symlink: atomically replace '/dev/mapper/vg0-root'
link_find_prioritized: found 'b253:1' claiming '/run/udev/links/root'
link_update: creating link '/dev/root' to '/dev/dm-1'
node_symlink: preserve already existing symlink '/dev/root' to 'dm-1'
udev_device_update_db: created db file '/run/udev/data/b253:1' for '/devices/virtual/block/dm-1'
UDEV_LOG=6
DEVPATH=/devices/virtual/block/dm-1
MAJOR=253
MINOR=1
DEVNAME=/dev/dm-1
DEVTYPE=disk
ACTION=change
SUBSYSTEM=block
DM_SBIN_PATH=/sbin
DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1
DM_UDEV_DISABLE_DISK_RULES_FLAG=1
DM_UDEV_DISABLE_OTHER_RULES_FLAG=1
DM_NAME=vg0-root
DM_UUID=LVM-7HyXGRaV4kjBTg0KI358CYlX33QongbP1vlreduBy4xnVglDH0pyTv83FwreVKVr
DM_SUSPENDED=0
DM_UDEV_RULES_VSN=2
DEVLINKS=/dev/mapper/vg0-root /dev/root
DM_VG_NAME=vg0
DM_LV_NAME=root
DM_LV_LAYER=
Back to top
View user's profile Send private message
elxa
n00b
n00b


Joined: 15 Oct 2012
Posts: 18

PostPosted: Wed Dec 12, 2012 1:02 am    Post subject: Reply with quote

I just ran into this issue, too. I am installing a new gentoo from a systemrescuecd chroot and dracut wouldn't include the "crypt" module.
I solved it by disabling "hostonly". So make sure you have either "hostonly=no" in /etc/dracut.conf or add "--hostonly" to your parameters when building a new initramfs. I guess this is only an issue from a chroot, on my laptop I have set hostonly=yes and no issues.
So disable "hostonly", boot your gentoo and enable it if you want.

from the dracut man page:

Quote:
If you want to create lighter, smaller initramfs images, you may want to specify the --host-only or -H option. Using this option, the resulting image will contain only those dracut
modules, kernel modules and filesystems, which are needed to boot this specific machine. This has the drawback, that you can't put the disk on another controller or machine, and that
you can't switch to another root filesystem, without recreating the initramfs image. The usage of the --host-only option is only for experts and you will have to keep the broken
pieces. At least keep a copy of a general purpose image (and corresponding kernel) as a fallback to rescue your system.


Quote:

-H, --hostonly
Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration.

Warning
If chrooted to another root other than the real root device, use "--fstab" and provide a valid /etc/fstab.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum