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.