How to restore Ubuntu boot after Windows 7 is reinstalled

Source: Internet
Author: User

After the system is reinstalled, the Ubuntu boot on the startup interface disappears and enters the newly installed window system. The following describes how to restore Ubuntu boot:

1) Prepare an Ubuntu system installation disk;

2) Place the Ubuntu system installation disk into the optical drive, restart the computer, enter the bios, and set the boot mode to the optical drive (CD/ROM) boot mode;

3) Save the settings and exit. Wait for a moment to go To the Ubuntu installation page. There are two options:

1. Try Ubuntu on the CD

2. Install the Ubuntu system on the computer

Select "Try Ubuntu system on this CD", enter the Ubuntu system, and open the terminal (the shortcut key is CTRL + ALT + t );

4) Enter Sudo-I in the terminal to obtain the administrator privilege)

5) Enter fdisk-l in the terminal (it is a lowercase letter 'L' to view the drive letter list)

The following information is displayed:

Disk/dev/SDA: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x70f7ab9c

Device boot start end blocks ID system
/Dev/sda1 1 1627 13060096 27 unknown
Partition 1 does not end on cylinder boundary.
/Dev/sda2*1627 1639102400 7 HPFs/NTFS
Partition 2 does not end on cylinder boundary.
/Dev/sda3 1639 8166 52429859 7 HPFs/NTFS
/Dev/sda4 8167 38913 246975277 + 5 extended
/Dev/sda5 8167 32385 194539082 + 7 HPFs/NTFS
/Dev/sda6 32386 38788 51432066 83 Linux
/Dev/sda7 38789 38913 1004031 82 Linux swap/Solaris

Then find the drive letter with ID 83. According to the information shown above, we can see that Ubuntu is installed in the sda6 partition.

6) Input Mount/dev/SDA */mnt on the terminal

(* Indicates the partition where the Ubuntu system is located, that is, the Partition Number with ID 83 in the result displayed in the previous step. As shown above, the partition is sda6,

So the input is Mount/dev/sda6/MNT.

Note: there is a space behind the mount and a space behind the sda6. Do not miss these two spaces; otherwise, an error will be reported)

7) after the preceding step, enter grub-install -- root-directory =/mnt/dev/SDA in the terminal.

Wait for a while. If installationfinished or no error reported appears, it indicates the operation is successful.

(Note: There is no space between grub-install, -- there is a space before the root, -- two '-' before the root, and one space behind the MNT)

8) at this point, the Ubuntu boot is basically restored. After the computer is restarted, you can see the familiar Ubuntu boot interface, enter the Ubuntu system, and open the terminal input.

Sudo Update-grub

Wait for a moment to display the following information:

Generating grub. cfg...
Found Linux image:/boot/vmlinuz-2.6.31-20-generic
Found initrd image:/boot/initrd. img-2.6.31-20-generic
Found memtest86 + image:/boot/memtest86 +. Bin
Found Windows Vista (loader) on/dev/sda1
Found Windows 7 (loader) on/dev/sda2
Done

The recovery is complete.

Article transferred from: http://www.cnblogs.com/dolphin0520/archive/2012/03/11/2390175.html

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.