Rocky 9.1 dracut 无法启动

Rocky 9.1 dracut 无法启动

我的 rocky 9.1 vm 内核无法在启动期间加载/启动/解密 LVM Luks2 卷。使用 5.14.0-162.6 启动可以正常工作。但无法启动最新的 5.14.0-162.18 或 5.14.0-162.12 内核,dracut 会抛出错误:

Starting dracut pre-udev hook.
dracut-pre-udev[397] modprobe: ERROR: could not insert 'dm_mod': Operation not permitted.

/运行/iniramfs/rdsosreport.txt

dmsetup ls --tree
/dev/mapper/control: open failed: No such device
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Incompatible libdevmapper 1.02.185 (2022-05-18) and kernel driver (unknown version).
Command failed.

我创建了一个新的 initramfs。Grub 设置和模块完全相同。

lsinitrd -m initramfs-5.14.0-162.6.1.el9_1.0.1.x86_64.img

Image: initramfs-5.14.0-162.6.1.el9_1.0.1.x86_64.img: 33M
========================================================================
Version: dracut-057-13.git20220816.el9

dracut modules:
bash
systemd
systemd-initrd
systemd-sysusers
dbus-broker
dbus
i18n
network-manager
network
ifcfg
prefixdevname
crypt
dm
kernel-modules
kernel-modules-extra
kernel-network-modules
lvm
qemu
qemu-net
resume
rootfs-block
terminfo
udev-rules
virtiofs
biosdevname
dracut-systemd
usrmount
base
fs-lib
memstrack
microcode_ctl-fw_dir_override
shutdown

lsinitrd -m initramfs-5.14.0-162.18.1.el9_1.x86_64.img

Image: initramfs-5.14.0-162.18.1.el9_1.x86_64.img: 33M
========================================================================
Version: dracut-057-13.git20220816.el9

dracut modules:
bash
systemd
systemd-initrd
systemd-sysusers
nss-softokn
dbus-broker
rngd
dbus
i18n
network-manager
network
ifcfg
prefixdevname
crypt
dm
kernel-modules
kernel-modules-extra
kernel-network-modules
lvm
qemu
qemu-net
resume
rootfs-block
terminfo
udev-rules
virtiofs
biosdevname
dracut-systemd
usrmount
base
fs-lib
memstrack
microcode_ctl-fw_dir_override
shutdown

所有软件包都是最新的。我重新安装了内核、内核模块和 lvm2,但没有成功。

我已成功通过 Live CD chroot 执行 /usr/lib/kernel/install.d/51-dracut-rescue.install 重建救援 initramfs 和 vmlinuz。救援系统正在启动 5.14.0-162.18 内核。但缺少很多模块。

lsmod
Module                  Size  Used by
fuse                  176128  1
drm                   622592  0
ext4                  962560  3
mbcache                16384  1 ext4
jbd2                  167936  1 ext4
dm_crypt               61440  2
sr_mod                 28672  0
cdrom                  81920  1 sr_mod
sg                     40960  0
ata_generic            16384  0
crct10dif_pclmul       16384  1
crc32_pclmul           16384  0
ata_piix               45056  0
crc32c_intel           24576  6
virtio_net             65536  0
libata                389120  2 ata_piix,ata_generic
ghash_clmulni_intel    16384  0
serio_raw              20480  0
net_failover           24576  1 virtio_net
virtio_blk             20480  4
failover               16384  1 net_failover
dm_mirror              28672  0
dm_region_hash         24576  1 dm_mirror
dm_log                 20480  2 dm_region_hash,dm_mirror
dm_mod                184320  17 dm_crypt,dm_log,dm_mirror

感谢您的任何建议!

答案1

initramfs在我做了一些研究并从以前的内核版本重新生成之后,这对我来说终于起作用了:

cd /boot
dracut -f initramfs-5.14.0-162.23.1.el9_1.x86_64.img 5.14.0-162.23.1.el9_1.x86_64
reboot

在 5.14.0-162.23.1.el9_1.x86_64 版本上启动正常……

相关内容