CentOS 7MBR grub boot sector and Recovery (glitch-yourself)

A, Recovery MBR boot sector
of a physical sector located MBR boot sector of a hard disk, also known as the primary boot sector of the sector, in addition to the portion of the data comprising a system boot program, also contains the entire hard disk partition table records. When the failure of the master boot sector, may result in the failure to enter the black state is such that the host does not turn on power. The following will lead everyone to learn how to recover when the MBR sector failure.
This step is typically the case where the troubleshooting are: MBR sector ahead of the backup → CD-ROM to boot into emergency mode → restored from a backup file.
The following will demonstrate the detailed process in detail MBR sector recovery.
1, the backup data to another disk MBR sector
1), and create a new disk partition.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
2), on the new disk format and mount.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
3) to copy the MBR sector data to the new disk.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
2, simulated fault MBR sector
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
3, the boot image to restore the emergency mode mbr sector
mbr sector failure host can not restart normally, so when the host computer to restart the reading of the eye grassland Press esc to enter a mode, since we are using mirror instead of the guide so here we choose the third.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
Here we have chosen the difficult problems of mbr problem solving.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
Here we select the second pair of CentOS 7 for diagnosis.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
The interface we choose a command into the emergency mode.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
Found in the emergency command mode and we do not just mount points, so we re-mount the new disk here.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
The backup copy data back into the mbr sector repair.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
4, restart the server for authentication.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)

Two, grub menu resume
preparations: Analog fault grub menu
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)

grub menu configuration file is deleted again after restarting the server will be shown below, which can not start properly.
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
After the server restart, after a few steps with the same MBR sector recovery operations until entering the emergency mode command.
1, the guide rescue mode, the mirroring system load
command: CHROOT / mnt / sysimage /
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
2, to re-establish the partition sda load
command: the install-grub2 / dev / sda
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
. 3, rebuild grub profile menu
command: grub2-mkconfig -o / boot /grub2/grub.cfg
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
4, after exiting the bash mode to restart the server to verify whether the normal boot
exit
reboot
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)
CentOS 7MBR grub boot sector and Recovery (glitch-yourself)

Guess you like

Origin blog.51cto.com/14449528/2432447