Implementation of Grub Rescue repair methods

Source: Internet
Author: User

This article provides a detailed explanation of Grub Rescue restoration. The information in this article is summarized from various aspects. I hope the highlights of this article will become a fuse for the site!

Grub2 repair methods

1. Grub Rescue windows reinstallation causes grub2 to be rewritten and repaired
Method 1: grub4dos0.4.4
Add grub4dos to the Windows Startup item and click "start". Click "stick".) restart and select "go to grub" and enter "/boot" in the command line)
Code:
Grub> find -- set-root/boot/grub/core. img
Grub> kernel/boot/grub/core. img
Grub> boot

Go to the grub2 menu, enter the system, and then execute the Code:
Sudo grub-install/dev/sd?

Method 2: After Grub Rescue enters Livecd, fix the reference:
Sudo-I
Mount your root partition/mnt
Mount your/boot partition/mnt/boot # If yes
# Mount your other partitions, if any
# Rebuilding mbr from grub to sda
Grub-install -- root-directory =/mnt/dev/sda


2. Because the root partition uuid changes, it cannot be started normally. You can only enter the fix code in grub rescue mode:
Grub rescue> set
Grub rescue> prefix = (hd ?,?) /Grub
Grub rescue> root = hd ?,?
Grub rescue> set root = hd ?,?
Grub rescue> set prefix = (hd ?,?) /Boot/grub
Grub rescue> set
Grub rescue> root = hd ?,?
Grub rescue> prefix = (hd ?,?) /Boot/grub
Grub rescue> insmod/boot/grub/normal. mod
Grub rescue> normal

You can call up/boot/grub. cfg and modify the uuid,
Change to the command line
Grub> insmod/boot/grub/linux. mod
Grub> set root = hd ?,?
Grub> linux/boot/vmlinuz-*** root =/dev/sd ??
Grub> initrd/boot/initrg. img -****
Enter System
Hd ?,? Is the partition where the grub file is located, sda? Yes/partition.

3. Repair when Grub Rescuegrub module and configuration file grub. cfg are damaged and cannot be started
Start Livcd to enter the trial reference:
Sudo-I
Mount your root partition/mnt
Mount your/boot partition/mnt/boot # If yes
# Mount your other partitions, if any
# Rebuilding mbr from grub to sda
Grub-install -- root-directory =/mnt/dev/sda
# Rebuilding grub. cfg
Mount -- bind/proc/mnt/proc
Mount -- bind/dev/mnt/dev
Mount -- bind/sys/mnt/sys
Chroot/mnt update-grub
Umount/mnt/sys
Umount/mnt/dev

Umount/mnt/proc this article from the CSDN blog, reprint please indicate the source: http://blog.csdn.net/jikiwh/archive/2010/04/17/5497900.aspx

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.