Linux MBR corruption and how grub configuration file corruption is fixed

Source: Internet
Author: User

System environment: RHEL5.8 VMware


One, analog MBR damage:

1. Backup Mbr:dd if=/dev/sda of=/root/mbr.txt count=1 bs=512

2. Damage Mbr:dd If=/dev/zero OF=/DEV/SDA count=1 bs=200

3.reboot

4. Disc Repair: VMware Setup starts from CD

5. Enter the start screen: Boot:linux rescue (input) and enter

6. Enter the system: Enter the command grub into the Grub interface:

Grub>root (hd1,0) #有可能是 (hd0,0) or other

Grub>setup (HD1)

Grub>quit

7.sync;reboot

Repair complete, reboot and set from local


Second, the analog/boot/grub/grub.conf configuration file is missing

1.mv/boot/grub/grub.conf/root #将此文件移走

2.reboot system will go directly to the Grub interface

3.grub>find (hd0,0)/Press the TAB key to try to find the partition where the system resides

Grub>root (hd0,0)

grub>kernel/vmlinuz-#按Tab键补全

grub>initrd/initrd-#按Tab键补全

Grub>boot


4. Successfully enter the system and repair the grub.conf file:


Linux MBR corruption and how grub configuration file corruption is fixed

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.