How to fix grub damage in CentOS

Source: Internet
Author: User

How can we fix grub File Corruption?

1 intentional damage

#dd if=/dev/zero of=/dev/sda bs=100 count=1 #sync #sync

Because MBR occupies 512 bytes, the first 446 bytes are given to bootloader, the last 64 bytes are given to partition, And the last 2 bytes are magicnumber.

2. Restart the machine.

Unable to start the system

3. Repair grub in emergency rescue mode

3.1 mount the complete image file to the optical drive

3.2 adjust the boot sequence to enable the disc

Adjust the method shift +-Save and exit F10

3.3 Select emergency rescue mode

Enter

The intermediate process can be directly OK.

Continue

Go on

Entered

3.4 start repair

① Root Switch

1 chroot /mnt/sysimage

② Enter the grub command line

1 #grub

③ Use setup to install grub

3.5 restart the system

First, set the complete image that has just been attached to the optical drive.

Second, adjust the bios boot sequence to hard disk boot.

Related Article

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.