This article is for a single hard disk host, divided into three steps.
The first step:
Using LiveCD or a U-disk to boot your computer into Ubuntu, it's best to make sure the system versions are the same.
Menu System-Administration->disk Utility See the Ubuntu root partition number, such as/dev/sda6.
"If the boot partition is hung independently, remember the partition number of the boot partition"
Using the shortcut key ctrl+alt+t to bring up the terminal,
Execute command:
Sudo-i
Mount/dev/sda6/mnt
Write down the result of the following command:
Uname-r
Execute command:
Grub-install--ROOT-DIRECTORY=/MNT/DEV/SDA
Restart your computer.
Step Two:
If the system is ubuntu9.10, a black screen shell input interface may appear after the system restarts:
Sh:grub>
At this point, perform the following command to view the partition, and the partition number where the boot is located:
Ls-l
Based on the results, the execution
Sh:grub> Root (hd0, 6)
Note: The above 6 is based on the specific situation to be seen.
Then execute:
Sh:grub> Linux/boot/vmlinuz-2.6.35-22-generic Root=/dev/sda6
Note: Here 2.6.35-22-generic is the execution result of the uname-r mentioned above.
Then execute:
Sh:grub> Initrd/boot/inttrd.img-2.6.35-22-generic
Execute the following command to enter the system:
sh:grub> Boot
If the system is ubuntu-10.10, the boot menu of the previous reload system can be seen at this time of reboot.
Select Ubuntu System to boot.
Step Three:
Using the shortcut key ctrl+alt+t to bring up the terminal,
Execute command:
sudo update-grub2
If it is a ubunt-9.10 system, then continue with the following instruction:
sudo grub-install/dev/sda
To this, the repair is complete.
[email protected]:~$ sudo update-grub[sudo] password for jason:generating grub.cfg ... Found Linux Image:/boot/vmlinuz-2.6.35-22-genericfound initrd Image:/boot/initrd.img-2.6.35-22-genericfound memtest86+ Image:/boot/memtest86+.binfound Windows 7 (loader) On/dev/sda1done
Repair boot XP, Win7, Ubuntu after dual system reinstallation