how to create rescue initramfs image on centos 7?

After my last launch yum update my test box have kernel-3.10.0-327.13.1 installed. While installing, dracut generated initramfs-3.10.0-327.13.1.el7.x86_64.img, but initramfs-0-rescue-7da0bd6ff130413b99bf0b6a1bde637e.img left old with kernel-3.10.0-327. How to generate new rescue initramfs image with new kernel and new kernel modules like zfs installed?

1 Answer

It looks like the rescue kernel and image are created by /etc/kernel/postinst.d/51-dracut-rescue-postinst.sh when a kernel is installed for the first time. This script checks for the presence of the rescue kernel and image and doesn't create new ones when additional kernels are installed.

To regenerate them, you'll need to move the existing ones out of the way:

mv /boot/vmlinuz-0-rescue-$(cat /etc/machine-id){,.backup}
mv /boot/initramfs-0-rescue-$(cat /etc/machine-id).img{,.backup}

Then you can then run the script like:

/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh $(uname -r) /boot/vmlinuz-$(uname -r)
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like