This is applicable to LVM and UEFI (where grub2-install will fail)
This is a collection of the commands which I found necessary to reinstall grub from a live image using a chroot environment. I found all of these commands in various forum posts around the web and thought i would post them in one place as none of the individual posts worked for me while together they do have good information. please feel free to post if you think this is helpful so that it can possibly help someone else. thank you.
Notice: if anything in your system is installed in a non-standard location you may have to change some of the lines
Open a terminal and enter the following commands
Code:su - cd /mnt mount /dev/fedora/root ./ mount /dev/fedora/home home/ mount -t proc proc proc/ mount --rbind /sys sys/ mount --rbind /dev dev/ mount --rbind /var/run/ var/run/ chroot /mnt/ mount /boot/efi dhclient `/sbin/route -n | grep "^0.0.0.0" | rev | cut -d' ' -f1 | rev` yum -y update yum -y reinstall grub2 grub2-efi grub2-efi-modules shim grub2-mkconfig -o /boot/grub2/grub.cfg grub2-install /dev/sda


Reply With Quote
