Our discussion on Linux troubleshooting will continue in this post. Today we’ll see what to do if our grub.conf file is deleted. I spent hours to learn to overcome this problem and now I will tell you the solution so that you need not spend hours like I did. So don’t be a chicken-hearted fellow and delete your /boot/grub/grub.conf file and let the action begin.

Once you have deleted the grub.conf you’ll get grub prompt upon next boot.Now the problem is how to boot into our machine.To do so you need to issue following commands on your grub menu:

  • kernel /vmlinuz-2.6.18-128.el5
  • initrd /initrd-2.6.18-128.el5.img
  • boot

Restore missing grub.conf file in RHEL

I know that it’s not possible to remember the full name of kernel and initrd image. The value shown here is for my system and it may vary on your system. Don’t worry as you can use tab to complete the name.For kernel press tab after /v and it will auto-complete the name and for initrd you can press tab after typing /i.

After this the normal booting process starts but the problem is that you’ll have to do this every time you boot because there is no grub.conf file present in your system at this point of time.So it’s time to create it manually by using vim /boot/grub/grub.conf command and write down-

splashimage=(hd0,0)/grub/splash.xpm.gz

title Red Hat

root (hd0,0)

kernel /vmlinuz-2.6.18-128.el5

initrd /initrd-2.6.18-128.el5.img

Recover from missing grub.conf problem

Now save this file and reboot and now you can access your machine normally. Congrats as we have successfully recovered from missing grub.conf problem.