In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how CentOs7 fixes MBR and GRUB. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Repair MBR:
MBR (Master Boot Record Master Boot record):
The 0 cylinder, 0 head and 1 sector of the hard disk are called the main boot sector. Where 446Byte is bootloader,64Byte is Partition table, and the remaining 2Byte is magic number.
Backup MBR:
# dd if=/dev/sda of=/root/mbr.bak count=1 bs=512
Destroy bootloader:
# dd if=/dev/zero of=/dev/sda count=1 bs=200
The edge block size here is as long as it is less than or equal to 446.
Repair method:
1. Mount disk repair with the help of other systems.
The repair method is similar to CD repair, which also uses the grub2-install command.
2. Repair with the help of installation CD.
1)。 Load the CD and select troubleshooting in the CD boot interface:
2)。 Choose to enter rescue mode:
3)。 Press enter to continue:
4)。 Enter disk mount selection mode:
The disk will be mounted to / mnt/sysimage/
Continue mounts the partition as rw.
Read only mounts the partition as ro.
Skip skips and will mount the disk manually in the future.
5. Select continue and wait a moment to indicate that the mount is complete.
6. The command line that enters rescue mode at this point:
7. Use the grub2-install command to rebuild the bootloader:
# grub2-install root-directory=/mnt/sysimage / dev/sda
Show no errors, write to the hard disk using sync, restart the system with reboot.
8. There is no error after restart, and grub is running normally:
At this point, the MBR repair is complete.
Thank you for reading! This is the end of the article on "how CentOs7 fixes MBR and GRUB". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.