Ubuntu 10.10 + Win7 how to restore Ubuntu boot after Win7 is reinstalled

Source: Internet
Author: User
Cause: although I have been working in Ubuntu, I suddenly found that dreamweaver had the wordpress code prompt function a few days ago, which made the wolf feel at ease, so I plan to build the iis php environment on Windows 7, which is used as a game machine. After a while .... the tragedy found that the was service could not be opened, saying that the service could not be found. Baidu and google had a while and found that there were only two methods. They did not succeed after trying. you can only reinstall Windows Server 20.

Cause:
Although I have been working in Ubuntu, I suddenly found that dreamweaver had the wordpress code prompt function a few days ago, which made the Wolf very excited. So I plan to build the iis php environment on Windows 7, which is used as a game machine, after a while .... the tragedy found that the was service could not be opened, saying that the service could not be found. Baidu and google had a while and found that there were only two methods. They did not succeed after trying. you can only choose to reinstall it. Just install a windows server 2008 and feel the advantages of the server version windows.

After server 2008 is installed, restart is even more tragic to find that the grub Startup menu is missing... not to reinstall windows and then reinstall ubuntu... after a long time of configuration, OMG! The wolf decided not to reinstall ubuntu and asked google for help. After some time, he finally successfully guided the system back to ubuntu. Now let's talk about the guiding process. Note that the little wolf uses the liveCD method, that is, the CD used when the system is installed, and no children's shoes can be skipped, of course, if you want to refer to it, you can continue reading it.

Recovery guide method:

1. Put liveCD in it and restart it. When the page is displayed, select trial. Do not click Install.

2. After Entering the ubuntu trial version, open the terminal, in the upper left corner ofApplication> attachment> TerminalThat

3. Enter the following command:

Sudo fdisk-l // The result is similar to the following. Check the ubuntu root directory. You can only identify the root partition by yourself. You can determine whether it is the root partition from the partition size, that is, when ubuntu is installed, the mount point is/The partition

The result shows that the root partition is in sda12. because the wolf scored/partitioned 20 GB, and the root partition was first divided/partitioned, then a 20g/home partition is divided. So it is determined that sda12 is/partition, not sda13, although it is also 20G. Remember sda12.

Note:IfWhen partitioning, you split the boot partition separately. You need to find the boot partition by one more step:

As you can see, the boot partition is sda8, because it is the smallest, only 200 M. (what you did when installing ubuntu)

Remember sda8.

4. Input

Sudo mount/dev/sda8/mnt

Because the wolf separately splits the boot partition, and its location is sda8. if you didn't separate the boot partition, change the location

Sudo mount/dev/location of your/partition/mnt

5. Enter

Sudo grub-install -- root-directory =/mnt/dev/sda8

Similarly, if you do not separate the boot partition, change it

Sudo grub-install -- root-directory =/mnt/dev/Your/partition location

There should be no problem here, because if the location is incorrect and cannot be installed, you can always enter this command until the location is correct.

6. If no error report is displayed. Then you almost succeeded. Then sudo init 6. Restart.

7. After the restart, you will find that windows cannot be started, and the grub command line is entered. You are not far from success.

Input:

Root (hdX, Y) // x indicates the hard disk location. If you only have one hard disk, X = 0. If there are multiple hard disks, set x accordingly. Y indicates the location of the boot partition. Here is 8. If the boot partition is not separately divided, y indicates the location of your/partition.

Linux/vmlinuz-2.xxxxx-generic root =/dev/sda12, click tab here to complete the filling)

If the boot is not separately divided

Linux/boot/vmlinuz-2.xxxxx-generic root =/dev/sda12
Initrd/initrd. img-2.xxxxx-generic

Or

Initrd/boot/initrd. img-2.xxxxx-generic
Boot

It's almost done here, because you can enter the original ubuntu, but if you don't need it, you need to repeat the above work for the next restart. This is too confusing...

Then fix grub.

Open the terminal and enter

Sudo update-grub

See

Generating grub. cfg...
Found linux image:/boot/vmlinuz-2.6.35-27-generic
Found initrd image:/boot/initrd. img-2.6.35-27-genericFound Windows Server 2008 (loader) on/dev/sda1
Done

Congratulations, it is now fully completed. Restart and check if the grub boot menu is back ~

Related Article

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.