It was originally installed with win7 and ubuntu10.10 dual systems, and later I felt that too many software was installed in win7, So I simply had to reinstall the win7 system. I know that the Windows 7 system was successfully reinstalled. After the restart, I lost the original grub option and failed to enter the Ubuntu system. It was a headache. So I went online to Google and finally found a feasible solution. Let's write it down and share it with you.
Step 1: Use the boot disk made of livecd or USB flash disk to start from the USB flash disk and enter Ubuntu
Step 2: Select Ubuntu for trial
Step 3: Open the terminal and obtain the Administrator's permissions. # Sudo-I, then the operation is performed under the root user.
Step 4: Enter # fdisk-L. This statement is used to view the partition of the entire hard disk, but it is a pity that when I type this command, it is not as I thought, the partition is on that disk, but it is roughly described, for example:
/Dev/sda7 *** (size) Block Value
There is no corresponding mount point, for example,/dev/sda7 is mounted under the root directory. Therefore, when installing a Linux system, remember the general situation of your partition.
Step 5: After learning about the partitions in your Linux system, mount the partitions.
# Mount/dev/sda7/mnt (my/dev/sda7 is mounted to the root directory)
# Mount/dev/sda8/mnt/boot
# Mount/dev/sda9/mnt/home
Swap does not need to be mounted. When the mounting is correct, go to the next step;
Step 6: Execute the statement. To be honest, I haven't figured out what it means.
# Grub-install -- root-directory =/mnt/dev/SDA
If the execution is successful, a prompt is displayed: Installation finished. No error reported.
Step 7: After the above steps are completed, the grub option is displayed at the startup, and there is no update at all. It is possible that Windows 7 cannot be entered. Therefore, start Ubuntu and restart grub Based on the options. Open the terminal, Type
Sudo update-grub2
If the call succeeds, the following message is displayed:
Grub. cfg...
Found Debian Background: moreblue-orbit-grub.png
And so on.
Done
Step 8: restart the machine. If the previous steps are correct, congratulations! The Machine is recovered !!!