After the dual-system is re-installed, it will be restored to boot xp, win7, and ubuntu

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.