Introduction:
Grub is a startup manager for multiple operating systems. It is used to guide different systems, such as Windows and Linux.
Generally, you need to install Windows and Linux first, so that grub can take effect (grub is installed in Linux ).
After I reinstall windows these two days, grub does not work and cannot enter Linux (grub is set to Windows by default ).
If you do not want to reinstall Linux, You need to reinstall grub and save the collected information and verification results.
Preparations:
Confirm the location of the root partition in Linux. For example, if the root partition of my redhat9.0 is installed on the 3rd partition of the first hard disk
The commands identified by grub are root (hd0, 2) and the serial number starts from 0.
Note:
There is a space between root and (hd0, 2), and there is a space between setup and (hd0.
How to fix GRUB:
1. Place the first installation disc of Linux to the optical drive, restart the machine, and use the optical drive to start the system in BIOS. 2. After the installation interface of Linux is displayed, press [F5] to enter the Linux rescue mode. (You can also enter the rescue mode and enter "linux single root =/dev/hdxx initrd =" after the boot: prompt appears. Note: hdxx is the partition of your Linux system, for example, if redhat9.0 is stored in the first partition of the first hard disk, It is/dev/hda4) 3. after entering the Linux rescue mode, you need to perform some keyboards and some simple configurations (Press OK). After that, [continue ...... 4. then the prompt sh #(redhat9.0 is sh-2.05 #) 5 appears. in this case, you can operate grub. If you type GRUB: Sh # grub, the following prompt will appear: grub> 6. enter grub> root (hdx, Y) at the end of the prompt. Note: Tell the system the partition where your Linux Root partition is located (My redhat9.0 corresponds to root (hd0, 2) If you cannot remember, press the tab key after you type "root (HD. If it succeeds, type grub> setup (hd0). Note: Load grub into the master boot zone (MBR). You can also type setup (hdx, Y) to install grub in the desired location. If it succeeds, there will be a successful... 7. Grub> quit comment: Exit grub8. sh # exit comment: Exit Shell
Restart later. If (hdx, Y) is correct, you can use grub to boot.
However, although the repair is successful, it may be caused by some reasons, but it still cannot be guided, directly into windows.
Grub loading stage 1.5
Grub loading please wait...
Then go to windows...
The main cause is the problem of grub. The fix is successful, but the drive letter is incorrect. (This is generally caused by inconsistent system boot drive letters with your root drive)
Solution: Find the grub. conf file and modify it. After re-entering rescue mode, note sh # cd/mnt sh # cd sysimage: the actual Linux system is mounted to the/mnt/sysimage directory sh # cd boot sh # cd grub sh # vi grub. check whether the conf file is consistent with your previous root (hdx, Y. Generally, there is a problem here. You can change it back, and the operation is the same as that in Linux.
Q: What is the difference between hda and hd0?
It is mainly about naming. The hda name starts with a letter and the hd0 name starts with a number.
Hda = hd0
Hda8 = (hd0, 7) Note: hda starts with hda1.
[Reprinted] How to reinstall grub so that it can guide the dual-System