Recover Ubuntu after installing WINDOWS

Source: Internet
Author: User

I installed Windows 7 first, and then installed Ubuntu. Later I installed xp in ghost mode. xp cannot be started. By searching for UUID, I can start XP. The next day I thought that XP was installed in E40, AHCI driver problems, especially slow, and re-install win7, CD installation, but do not see ubuntu, by installing grub-pc to restore MBR Master Boot records, then reply to the original dual system.

 

I. Fixed the Windows XP system installed on the ghost.

Environment:

Lenovo E40, Spam

Win7 + ubuntu10.10 dual-System

Reinstallation reason: E40 fault, sleep for no reason, often blue screen

 

Find a ghost version of xp from the Internet, make it into a USB flash drive, install ghost, restart it 20 minutes later, enter xp, and the system is not found.

Cause:

Ghost version xp only copies the xp system to the system disk C without modifying MBR. Therefore, the MBR is the original WIN7 system, and MBR is the grub of Ubuntu, UUID is used to distinguish different partitions,

See the following table:

menuentry "Microsoft Windows 7 " {set root=(hd0,1)search –no-floppy –fs-uuid –set 4a807ca0807c93e3drivemap -s (hd0) $rootchainloader +1}

 

If this is the case, it is very easy to restore the system. Because the UUID is incorrect, we cannot find the partition where the XP system is located. First, we find the UUID of the partition where XP is located.

Steps:

1. restart the system and go to the Ubuntu selection screen,

2. Enter: C to go to grub> command line,

3. Enter ls-l to view and remember the UUID of the partition where xp is located.

4. Restart Ubuntu and modify the windows System Options in/boot/grub. cfg:

Menuentry "Microsoft WindowsXP"{Set root = (hd0, 1) search-no-floppy-fs-uuid-set xxxx-xxxx# InputUUIDDrivemap-s (hd0) $ rootchainloader + 1}

Then you can enter the XP system.

 

Ii. Install win7 to retrieve the original ubuntu

Environment:

Lenovo E40, Spam

XP + ubuntu10.10 dual-System

Reason for reinstallation: XP does not have an AHCI driver, and the disk access speed is very slow. I don't know if it is because of the driver and the time is limited. No matter what, install it back to win7 ~~

Windows 7 was installed on the CD. After more than 20 minutes, there was no problem with Windows 7, but there was no boot menu.

Cause:

Windows is not tolerant at all. During the installation process, MBR is overwritten, and the existence of ubuntu is completely ignored. Therefore, to find ubuntu, install the new MBR first. We can use ubuntu LiveCD to install grub and find the original ubuntu.

PS: windows is really overbearing and spam. After using MAC and ubuntu, you will feel that it is speechless ...... There is no way. tianchao's plug-ins support IE and the embedded development IDE environment is still windows.

 

First, find a LiveCD. If there is no LiveCD, you can download an image and then compress it into a CD or install it into a USB flash drive. I installed it with a USB flash drive, with UItraISO, you can easily create a disk or a system file. This is not the focus.

Assume that you use the USB flash drive to enter ubuntu. Select the first option to try out the system without installing ubuntu.

 

1. Open the terminal, first update the apt source,

Sudo apt-get update

2. Install grub-pc (if it is ubuntu9.04, grub is installed)

Sudo apt-get install grub-pc

 

3. Open Disk Utilty and find the partition where your ubuntu is located. For example, if my partition is sda7, mount it to the LiveCD directory and prepare to install grub.

Sudo mount/dev/sda7/mnt

4. Run the grub-install command to install the new grub

Grub-install -- root-directory =/media/bootdir/dev/sda

If "Installation finished. No error reported! "Indicates that the operation is successful. If there is a few lines behind this sentence, it will fail,

The grub version you have installed is incorrect. You should install grub-pc

Restart the computer. The grub menu is displayed successfully, but windows 7 is not available. Only ubuntu is available. This is because you have not updated the menu.

Go to the ubuntu system and enter sudo update-grub in the terminal.

A text similar to the following indicates that the operation is successful:

Grub. cfg...

Found linux image:/boot/vmlinuz-2.6.31-15-generic

Found initrd image:/boot/initrd. img-2.6.31-15-generic

Found memtest86 + image:/boot/memtest86 +. bin

Found Windows 7 (loader) on/dev/sda1

Done

 

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.