My machine is installed with Windows XP and ubuntu7.04, which may cause us to reinstall the unstable Windows due to some inexplicable problems. After windows is reinstalled, the MBR of the hard disk will be overwritten without any prompt. The following steps describe how to restore the Startup menu and go to Ubuntu:
Note: ensure that the LINUX partition is not formatted during windows reinstallation.
Step 1 download the latest grub4dos from the following website:
Http://download.gna.org/grub4dos/
Decompress the newly downloaded grub4dosto the system drive C, and copy the grldrand grub.exe files and menu. lst files under the folder to the root directory of the system drive. Other files are ignored for the moment. We don't need them here.
Step 2. Open the root directory of the system and remove the check box before "Hiding protected operating system files (recommended)" in "Folder Options, make sure that all folders are displayed ".
Find the boot. ini file in the root directory and right-click it to remove the "read-only" attribute. Open boot. ini in notepad and add
C:/grldr = "Start with grub4dos"
Step 3. restart the computer and select start with grub4dos.
Then select "Enter command line"
Enter the following command line:
Root (hdx, Y)
If you do not know the input of X and Y:
#> Find/boot/GRUB/stage1
PS: there is a space between root and (hdx, Y. Hdx is the number of hard disks. It starts from scratch. If it is a hard disk, hd0 is used, and Y is the root partition.
Run: setup (hdx)
Run reboot and restart the computer.
Then you will see the boot menu, select the correct option to enter Ubuntu;
Sometimes an error message such as error: Can not mount selected partition indicates that the disk partition cannot be added to the disk, adjusting the partition size by PQ in the window is also prone to some inexplicable problems such as re-modification of the partition table. The preceding error indicates that the partition table has been rewritten and the Partition Number of the original Linux boot has changed. Therefore, the grub boot error occurs. The solution is as follows:
After selecting unbuntu in the Start Menu, do not press enter to enter. Press e to enter the edit grub mode. Modify the value y of root (hd0, Y ).
For example, change the original root (hd0, 7) to (hd0, 8 ). Then, reboot server B. If you can enter the system, it indicates that the system is correct. If the same error is reported, repeat the preceding steps to change (hd0, Y) to another value, and try it several times.
After successfully logging on to Linux, you also need to modify menu. lst to achieve the effect once and for all. Open the terminal:
Sudo VI/boot/GRUB/menu. lst
For example, you can change root (hd0, 7) to the correct value (hd0, Y.
Of course, it would be easier to restore the disk when it is installed. I will not elaborate on it here ........