5

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)

3 Answers 3

7

Remove dracut-config-rescue package:

# yum remove dracut-config-rescue
1
  • This should be the accepted answer, as it is the correct solution.
    – nturner
    Commented Aug 28, 2017 at 23:14
6

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.

1
  • See @Tomek's answer below for a simpler, more correct solution.
    – nturner
    Commented Aug 28, 2017 at 23:16
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)

2
  • 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.
    – hnsr
    Commented Jan 19, 2015 at 15:04
  • 1
    I did it as above and still appearing the rescue boot option, do you know anything else on this?
    – felipekm
    Commented May 26, 2015 at 21:21

You must log in to answer this question.

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