2

To fix an unbootable SLES15 system, I booted the Rescue image, mounted the existing system to /mnt, and then did chroot /mnt (I'm leaving out the details, as those are probably known (or found in How do you create a chroot environment for OpenSUSE Leap?)).

When trying to rebuild the initrd using dracut there is the problem that the kernel being used in the rescue system does not match the kernel found in the chroot environment.

For example the output is:

dracut: cannot find module directory /lib/modules/5.3.18.57-default

(5.3.18.57-default is the kernel from the rescue system; the kernel that does not boot is 5.3.18-150300.59.46-default for example)

I'm unsure what the correct syntax will be; do I have to spoecify the full path for the initrd and kernel, and if so the "vmlinuz" variant, or the "vmlinux.gz" variant?

1 Answer 1

4

For just recreating the initrd, first find out the kernel(s) installed, using

rpm -qa kernel-default

For example the output might be:

kernel-default-5.3.18-150300.59.43.1.x86_64
kernel-default-5.3.18-150300.59.46.1.x86_64

As an alternative you may want to list /lib/modules for kernel versions. The result might be:

> ls -1 /lib/modules/
5.3.18-150300.59.43-default
5.3.18-150300.59.46-default
5.3.18-lp152.72-default

Then run the command with an empty first parameter and the kernel version as second parameter, like this (note the changes compared to RPM output):

dracut '' 5.3.18-150300.59.46-default

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .