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)

hnsr
  • 143
  • 2
  • 7

3 Answers3

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.

Braiam
  • 35,380
  • 25
  • 108
  • 167
Robin Dong
  • 76
  • 1
  • 2
6

Remove dracut-config-rescue package:

# yum remove dracut-config-rescue
Tomek
  • 161
  • 1
  • 2
2

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)

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