Destruction and recovery of gurb (recovery with backup body)
(1) Backup
DD if=/dev/sda of=grub.bak bs=446 count=1 // back up the bootstrapper portion of the MBR
(2) Destroying the first 446 bytes in the MBR
DD if=/dev/zero of=/dev/sda bs=446 count=1
(3) Restore the first 446 bytes of MBR
===> into rescue mode (at this point on the bootable CD, the system will mount our hard drive system to the/mnt/sysimage on the disc)
chroot // Enter the hard drive DD if=root/grub.bak of=/dev/sda bs=446 count=1// Restore Backup
Gurb Destruction and recovery (no backup body)
(1) Destroying the first 446 bytes in the MBR
DD if=/dev/zero of=/dev/sda bs=446 count=1
(2) Restore the first 446 bytes of MBR (the method of reloading the GRUB program)
===> into rescue mode
chroot /mnt/sysimage# Grub-Install /DEV/SDA
DPT Destruction and recovery (recovery with backup)
(1) Backup DPT
Note here: It is useless to put the backup on the current hard drive! Since we are going to destroy its partition later, the backup will be lost!
So you can choose to place the partition on another hard disk or on another computer or on an FTP server by:
A. Partitioning, formatting, and mounting another hard drive: fdisk/dev/sdb;mkfs.ext4/dev/sdb1;mount/dev/sdb1/mnt
B. SCP to another computer or upload an FTP server (step slightly)
DD if=/dev/sda of=/mnt/dpt.bak skip=446 bs=1 count= //
(2) Destroy DPT
DD if=/dev/zero of=/dev/sda seek=446 bs=1 count=
Error 22 Errors When restarting after ===> is destroyed
(3) Restore dpt===> into rescue mode
(Note: Because SDA does not have a disk partition, the hard disk system does not automatically mount to the/mnt/sysimage under the disc, meaning that only the pseudo-root of the disc can be entered)
(Check the disk partition table of/DEV/SDA and/dev/sdb at this time, you will find that the SDA has not seen the disk partition, but SDB also maintains a DPT)
mkdir Mount /dev/sdb1 AA; ls SCP [email protected]10.0. 2.253:/mnt/dpt.bak./
DD if=aa/dpt.bak of=/dev/sda seek=446 bs=1 count=// Restore Backup
[Disk Management and partition]--MBR destruction and Repair