Solution to Ubuntu startup failure after Windows 7 is reinstalled

Source: Internet
Author: User

Reprinted please note address: http://blog.csdn.net/ethan_xue/article/details/7538568

1. Use a USB flash drive to burn a Ubuntu image. Only images with difficulties are attached (images from other blogs are lazy)

Click to write

2. Set BIOS to USB boot

3. Ubuntu will be started from the USB flash drive. Click to try ubuntu.

4. Press CTRL + ALT + T to open the terminal and enter Sudo-I (obtain administrator privileges)

Enter fdisk-l (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. Sometimes there are more than 83 partitions, which can be determined based on the size of the partition.

5. Enter Mount/dev/SDA */mnt on the terminal.

Mount/dev/SDA */mnt/boot

(* 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)

6. After the previous 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)

7. 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.

Reference: 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.