After the dual-system is re-installed, it will be restored to boot xp, win7, and ubuntu
This article consists of three steps for a single hard disk host.
Step 1:
Use liveCD or USB flash drive to guide the computer into ubuntu. It is best to ensure that the system versions of the two are the same.
Choose System> Administration> Disk Utility to view the ubuntu root Partition Number, for example,/dev/sda6.
[If it is independently attached to the boot partition, remember the Partition Number of the boot partition]
Call up the terminal by pressing CTRL + ALT + T,
Run the following command:
sudo -i
mount /dev/sda6 /mnt
Write down the result of the following command:
uname -r
Run the following command:
grub-install --root-directory=/mnt /dev/sda
Restart your computer.
Step 2:
If it is Ubuntu, the black screen shell input interface may appear after the system is restarted:
sh:grub>
Run the following command to view the partition information and check the Partition Number of the boot instance:
ls -l
Execute the command again based on the result.
sh:grub> root (hd0, 6)
Note: The above 6 is displayed based on the actual situation.
Run the following command:
sh:grub> linux /boot/vmlinuz-2.6.35-22-generic root=/dev/sda6
Note: 2.6.35-22-generic is the execution result of the uname-r mentioned above.
Run the following command:
sh:grub> initrd /boot/inttrd.img-2.6.35-22-generic
Run the following command to enter the system:
sh:grub> boot
If the system is a ubuntu-10.10, you can see the boot menu before reinstalling the system at the time of restart.
Select ubuntu to start.
Step 3:
Call up the terminal by pressing CTRL + ALT + T,
Run the following command:
sudo update-grub2
If it is a ubunt-9.10 system, continue executing the following command:
sudo grub-install /dev/sda
At this point, the repair is completed.
jason@ubuntu:~$ 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