Restart Ubuntu after Windows 7 is reinstalled.

Source: Internet
Author: User

After the system is reinstalled, the Ubuntu boot on the startup interface disappears. The following describes how to recover a boot disk from a USB device:

1) Prepare a USB boot disk (USB flash drive and mobile hard drive );

2) connect the USB boot device of the Ubuntu system to the computer, restart the computer, enter the bios, and set the boot to USB boot;

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

1. Try Ubuntu

2. Install the Ubuntu system on the computer

Select "Try Ubuntu System", 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 CD/mnt on the terminal

Mkdir TMP

Mount/dev/SDA */mnt/tmp

(* 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/tmp.

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/tmp/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 root, -- two '-' before root, and one space behind/mnt/tmp)

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.

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.