restore grub installation [Fedora, Centos, RHEL & derivates]
Have you ever found yourself with a non-booting GNU/Linux box?
If the cause is a corrupted grub installation (by a bad move on kernel upgrade, a Windows update or whatever) all you have to do is simply:
- set the BIOS of your machine to have CD/DVD-rom player as the 1st boot device;
- insert the Fedora/CentOS/RHEL media on it and boot the system,
- choose {or manually insert}: linux rescue and press return,
- a number of messages will be displayed until you will be taken to a working shell and your old system is mounted on /mnt/sysimage path,
- give 'chroot /mnt/sysimage' command to "phisically translate" the shell on your original installation
- 'cd /boot/grub'
- then check where grub results installed if you have different disks on your machine with a grep '#boot' grub.conf
- read the output, verify it's correct eventually with the help of an fdisk -l command,
- now you are ready to install grub, after you've choosen the device (or partition) where it sould is located give the command grub-install /dev/device-choosen {ie that could be /dev/sda}
- now close the shell and reboot, the system should be working correctly now!
Enjoy ;-)