Repair grub (MBR)

Source: Internet
Author: User

Grub is the management setting for Linux * users to open the machine. In ubuntu, these resources are placed under/boot/GRUB/object.

It is often seen on the Internet that grub crashes (it should be said that MBR crashes) and cannot be opened, sometimes it is caused by installing windows after ubuntu. How can I fix this phenomenon?

MBR crash (if you do not know about MBR, check it with Google). If the target of/boot/GRUB/is complete, the MBR can be rebuilt.

In UBUNTU Forum, I will see a non-negative forum.Article(As shown below), the original article is too long. sort out some important points and take a test.

How to restore grub from a live Ubuntu CD.

This issue can be solved by using the grub command.

First, take out Ubuntu live-Cd and open the terminal interface after the machine is turned on. Grub needs to use the root permission. Therefore, the following command should be taken first:

# Sudo grub

After entering the grub interface, the grub prompt "Reply> grub> appears. At this time, you may wish to use help to see what things can be used, for example, four commands, find, root, setup, and quit, are required in this example. Use help [find, root, setup, and quit] to check the usage of these commands.

Grub> Find/boot/GRUB/stage1
(Hd0, 0)

The above grub command can find out where your MBR is installed.

Next, use root to set MBR:

Grub> root (hd0, 0)

PS: the value (hd0, 0). Please complete the final result of the find command.

Set hosts to MBR:

Grub> setup (hd0)

Note that the setup command only needs to be added to the hard disk replacement, such as hd0, and does not need to be added to the partition table.

Use quit to end the procedure:

Grub> quit

After the above operations, after the machine is restarted, grub should be ready for normal use.

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.