How to fix grub rescue

Source: Internet
Author: User

[Switch] grub rescue Repair Method

From: http://www.2cto.com/ OS /201111/112327.html

Symptoms:
Boot display: grub Loading

Error: unknow filesystem

Grub rescue>

Cause:
The following operations have been found to cause this problem:
1. To delete Ubuntu, delete/format the partition where Ubuntu is located in windows.
2. Adjust the disk and use tools to merge, split, adjust, and delete partitions to change the number of disk partitions.
3. reinstall the system and install Linux to a new partition. The original partition has been formatted, but grub2 has not been re-installed.
4. Use the Ubuntu backup tool/derivative version manufacturing tool to restore the primary partition to the old version of 8. X. As a result, grub of the old version is grub1, and grub2 is destroyed.

Generally, the operator does not know that grub2 is divided into two parts, one part (generally) written on MBR, the other part is written in the/boot/GRUB directory of a partition (if/boot is separately partitioned, it is directly written in the/GRUB directory of the corresponding partition. As a result, the part in the MBR of grub2 cannot find the part in the/GRUB directory (or the part has been deleted ).

Ideas:
Method 1: Delete grub2 permanently so that the prompt does not appear again:
This method is applicable to people who no longer want to use Ubuntu and want to switch back to Windows.
This is very simple, as long as you have a Windows boot disk (not a ghost), use it to start, to select the installation location, do not actually install, exit and restart it.
You can also use it to start to the fault recovery platform and run fixboot or fixmbr.
Run bootrec.exe/fixmbr under the win7 command line.
(/Fixmbr repair MBR,/fixboot repair startup sector,/scanos detection installed win7,/rebuildbcd reconstruction BCD .)

Method 2: reinstall and fix grub2
1. Run the LS command to find the partition where Ubuntu is installed:
Run the following command under grub rescue>:

Code: Ls

 

All disk partition information is listed, for example:

 

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

 

2. Call the following commands in sequence: X indicates the number of each partition.
If/bootNo separatePartition, run the following command:

 

Code: Ls (hd0, x)/boot/GRUB


Www.2cto.com

If/bootSeparatePartition, use the following command:

 

Code: Ls (hd0, x)/GRUB



Under normal circumstances, hundreds of files are listed. Many files have extensions:. Mod,. lst, And. IMG, and grub. cfg. If the file in the folder is displayed (hd0, 5), it indicates that Linux is installed in this partition.

4. If the correct grub directory is found, try to temporarily associate the two parts of grub as follows:
Below is/bootNo separatePartition command:

 

Reference: Grub rescue> set root = (hd0, 5)
Grub rescue> set prefix = (hd0, 5)/boot/GRUB
Grub rescue> insmod/boot/GRUB/normal. Mod



Below is/bootSeparatePartition command: (these statements need to be verified)

 

Reference: Grub rescue> set root = (hd0, 5)
Grub rescue> set prefix = (hd0, 5)/GRUB
Grub rescue> insmod/GRUB/normal. Mod



Then, call the following command to display the lost GRUB menu.
Grub rescue> normal
But don't be happy. If the problem persists during the restart, we need to go to Linux and fix grub.
Start up. After Entering Ubuntu, run the following command on the terminal:

 

Code: 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)
Have the grub Startup Menu been restored? Congratulations! recovery successful!
5. If the correct/GRUB directory cannot be found, for example, 3rd or 4 misoperations, try to find whether the Linux core file exists. Then, call the following command in sequence: X indicates the number of each partition:
Grub rescue>, enter:
If/bootNo separatePartition:

 

Code: Ls (hd0, x)/boot



If/bootSeparatePartition, then:

 

Code: Ls (hd0, X)

 

Find a file named like a vmlinuz-3.0.0-12-generic, which is the Linux core file, if found, write down the value of X in (hd0, X. Assume that the files in the folder are displayed when (hd0, 5) is found.

Start with live CD or live USB, and enter the following commands in the Ubuntu terminal of live CD (In sda5, "5" must be changed to the value recorded above.) (The two sentences need to be verified ):
If/bootNo separatePartition:

 

Code: Sudo Mount/dev/sda5/mnt
Sudo grub-install -- boot-directory =/mnt/boot/dev/SDA

 

If/bootSeparatePartition, then:

 

Code: Sudo Mount/dev/sda5/mnt
Sudo grub-install -- boot-directory =/mnt/dev/SDA



Then restart.

(The above two commands can solve the problem of incorrect grub installation location during Ubuntu installation,NoInstall grub to/dev/SDA, so that the Ubuntu startup item does not directly go to Windows during startup, but you need to determine it by yourself"5" in sda5".)
6. If you do not have a Linux core file, reinstall it.

From tattoo blog

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.