LInix_Ubuntu boots up and appears grub rescue> terminal mode repair method

ref: http://www.linuxidc.com/Linux/2012-07/65249.htm

 

Ubuntu boot appears grub rescue> terminal mode repair method

 

1. First use the ls command to find out which partition Ubuntu is installed in:

     grub rescue>ls

     Will list all disk partition information, for example:

     (hd0),(hd0,msdos3),(hd0,msdos2),(hd0,msdos1)

 

2. Then call the following commands in turn: msdosX represents each partition, note that there is no space between msdos and the number!

     grub rescue>ls (hd0,msdosX)/boot/grub

     If you can't find it, you need to check whether the path of grub is wrong due to differences in Linux versions, such as direct ls(hd0,X)/grub and so on.

 

3. Assuming that (hd0, msdos3) is found and the files in the folder are displayed, it means that Linux is installed in this partition.

 

4. Invoke the following command:

    grub rescue>set root=(hd0,msdos3)

    grub rescue>set prefix=(hd0,msdos3)/boot/grub

    grub rescue>insmod /boot/grub/normal.mod

    or

grub rescue>insmod normal

 

5. Then call the following command to display the missing grub menu.

    grub rescue>normal

 

6. But don't be happy. If the problem still exists after restarting at this time, we need to enter Linux and repair grub.

    After entering Linux, execute on the command line:

    sudo update-grub

    sudo grub-install /dev/sda

    (sda is your hard disk number, do not specify the partition number, such as sda1, sda5, etc. are not correct)

 

7. Reboot to test whether the grub boot menu has been restored.

 

Note: sudo gedit /boot/grub/grub.cfg can modify grub's boot menu.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327059532&siteId=291194637