How do I disable the creation of the rescue boot image on CentOS?

6,662

Solution 1

Open the file /usr/lib/dracut/dracut.conf.d/02-rescue.conf and change

dracut_rescue_image="yes"

to

dracut_rescue_image="no"

This seems to be the only way for CentOS 7.

Solution 2

Remove dracut-config-rescue package:

# yum remove dracut-config-rescue

Solution 3

To answer my own question;

The rescue image is automatically generated by dracut after a new kernel is installed, and this can be prevented by creating a file under /etc/dracut.conf.d/, containing:

dracut_rescue_image="no"

(The file must have a '.conf' extension)

Share:
6,662

Related videos on Youtube

hnsr
Author by

hnsr

Updated on September 18, 2022

Comments

  • hnsr
    hnsr over 1 year

    To make a long story short, my (CentOS 7) server's /boot is too small (100MiB) to hold 2 kernels plus the automatically generated rescue image. I want to avoid the hassle of repartitioning and reinstalling my server by preventing the rescue image from being generated. This would leave enough space for at least 2 kernels, and I can still use my hoster's netboot rescue solution should it be needed.

    (I know the only 'right' way to deal with this is to fix my partition scheme, but considering the downtime involved with that I wanted to try a more pragmatic solution first)

  • hnsr
    hnsr over 9 years
    And, to expand on my answer, even with an alternative 'rescue' solution, it may be unwise to disable this, as the rescue kernel/initramfs are more than just for fixing a broken system. Newer RHEL/CentOS/Fedora releases only include the kernel modules for the hardware of the currently running system for newly installed kernels, and the 'rescue' kernel can then be used to update these if hardware is added or changed.
  • MichaelLi
    MichaelLi almost 9 years
    I did it as above and still appearing the rescue boot option, do you know anything else on this?
  • nturner
    nturner over 6 years
    This should be the accepted answer, as it is the correct solution.
  • nturner
    nturner over 6 years
    See @Tomek's answer below for a simpler, more correct solution.