Linux grub2 Recovery steps:
Boot Hints Grub rescue>
The Linux system boot failed because the MBR was modified or the Boot menu tool was used under Windows. (Individual for CENTOS7)
1. If you have a USB flash drive system or CD-ROM you can enter rescue mode DF-LH view the boot partition's disk partition number (SDA6 after personal query).
2. Reboot into grub rescue> ls to see if the disk partition information is currently displayed (as I have already queried so direct action, if there is no query, follow step 1.) )
3.set root= (HD0,MSDOS6) set prefix= (HD0,MSDOS6)/grub2 (grub2 to/after not wrapped) insmod Normal normal
4. The boot menu can be seen in normal conditions.
5. Enter the Linux system
6.grub2-mkconfig-o/boot/grub2/grub.cfg rebuild Boot, if the boot menu is not a problem, you can not rebuild the boot.
7.grub-install/dev/sda writes the GRUB2 boot to the MBR. Restart to see the normal boot menu.
As for the case that has been completely covered by Windows BL, enter the rescue mode directly with a USB flash drive or CD-ROM: (There is no earthly, self-guessing feasible method)
Chroot/mnt/sysimage (seems to have forgotten.) LS can be queried. )
Grub2-mkconfig-o/boot/grub2/grub.cfg Reconstruction Guide
Grub2-install/dev/sda
The Windows menu will be overwritten. After rebooting into Linux, add the Windows boot information.
Edit the file and add it later:
Menuentry "Windows 7 (Loader) (ON/DEV/SDA1)"--class windows--class os {
Insmod Part_msdos
Insmod NTFS
Set root= ' (HD0,MSDOS1) '
Chainloader +1
}
This article is from the Linux Learning Notes blog, so be sure to keep this source http://firestorm.blog.51cto.com/7388617/1767318
Linux grub2 Recovery