4

I updated a server this morning and the latest kernel panics during boot. Upon review of the grub.conf file I found the initrd path was missing. Is there a way to fix this issue? Or should I remove the most recent kernel entry from grub.conf and boot from the previous kernel (tested working)?

grub.conf file:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_spots-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.20.3.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-431.20.3.el6.x86_64 ro root=/dev/mapper/vg_spots-lv_root rd_LVM_LV=vg_spots/lv_root rd_LVM_LV=vg_spots/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
title CentOS (2.6.32-358.14.1.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-358.14.1.el6.x86_64 ro root=/dev/mapper/vg_spots-lv_root rd_LVM_LV=vg_spots/lv_root rd_LVM_LV=vg_spots/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
    initrd /initramfs-2.6.32-358.14.1.el6.x86_64.img

I found this link explaining how to re-build the init file. Rebuild Initrd

Not totally understanding all the risks, would this be a good idea to try? This is a production server and I don't want to take it down completely. :)

1
  • If it fails to boot in a VPS/EC2 instance where you don't have arrow keys, mount it to another instance and edit the file to change default=1 and it will select the 2nd entry.
    – Chloe
    Jun 5, 2017 at 16:41

2 Answers 2

4

You can just add the initrd back in yourself.

initrd /initramfs-2.6.32-431.20.3.el6.x86_64.img

You should check your /boot directory and ensure that it is actually present.

To fix it permanently for future upgrades, run

# yum reinstall kernel.x86_64
4
  • Doesn't exist... Looks like rebuild might be my only option. Jul 3, 2014 at 16:25
  • Just reinstall that particular kernel with yum reinstall then. It should rebuild the initrd. Jul 3, 2014 at 16:31
  • 2
    Yum reinstall did the trick! Thank you! yum reinstall kernel-2.6.32-431.20.3.el6 Jul 3, 2014 at 16:55
  • The generic form # yum reinstall kernel.x86_64 also works.
    – Chloe
    Jun 5, 2017 at 16:39
1

If you can boot into one of the older kernel versions, see if you can run update-grub to fix the issue. Otherwise, as Michael said, you can just add the entry in by hand supposing the actual initrd file exists.

You must log in to answer this question.

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