How to fix Ubuntu startup and grub rescue

Source: Internet
Author: User
    • Problem:

Previously, the system was Windows 7 64bit (C disk) + D, and E disk (both NTFs and UBUNTU.

Today, the elastic Block Storage (e) disk is deleted in Windows 7 and you are going to install RedHat 6 on it. After Windows 7 is restarted, the GRUB menu of ubuntu cannot be started. Invalid filesystem is displayed on the screen. (If you remember correctly, haha)

    • Analysis

In Windows, the partition status is changed, and a partition before Ubuntu is deleted. As a result, the partition of Ubuntu is changed from sda5 to sda4, so that grub cannot be found.

Grub rescue>

    • Solution

1. Run the LS command to find the partition where Ubuntu is installed:

Grub rescue> ls

All disk partition information is listed, for example:

(Hd0, 1), (hd0, 5), (hd0, 3), (hd0, 2)

2. Call the following commands in sequence: X indicates the number of each partition.

Grub rescue> ls (hd0, x)/boot/GRUB

If not, check whether the grub path is incorrect due to Linux version differences, such as direct ls (hd0, x)/grub.

3. If the file in the folder is displayed when (hd0, 5) is found, it indicates that Linux is installed in this partition.

4. Call the following command:

Grub rescue> set root = (hd0, 5)

Grub rescue> set prefix = (hd0, 5)/boot/GRUB

Grub rescue> insmod/boot/GRUB/normal. Mod

5. Call the following command to display the lost GRUB menu.

Grub rescue> normal

6. Don't be happy. If the problem persists at this time, we need to go to Linux and fix grub.

After entering Linux, run the following command in the command line:

Sudo Update-grub

Sudo grub-install/dev/SDA

(SDA is your hard disk number. do not specify a partition number, such as sda1 or sda5)

7. Have the grub Startup Menu been restored after the restart test? Congratulations! recovery successful!

 

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.