Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS7 has nothing to delete bootloader and stage1.5 stage to play.

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

CentOS7 has nothing to delete bootloader and stage1.5 stage to play.

It is well known that bootloader is located in the first 446 bytes of the disk and belongs to the stage1.0 stage.

A section of disk space after 512 bytes is the stage1.5 phase, which is used to find the booted img and vmlinuz

As we all know, stage1.0-stage2.0 can use grub2-install (CentOS6 is grub-install)

Reference: https://s4.51cto.com/wyfs02/M02/87/20/wKiom1fVBELjXsvaAAUkuL83t2Q304.jpg

First, delete bootlater1, dd delete the first 446 bytes of disk [root@localhost ~] # dd if=/dev/zero of=/dev/sda bs=1 count=446446+0 records in446+0 records out446 bytes (446B) copied, 0.000932527 s 478 kB/s [root@localhost ~] # hexdump-C-n 512 / dev/sda00000000 00000000 00000000 00000000 |. | * 000001b0 000000000000000000000000000 80 20 |. | 000001c0 21 00 83 aa 28 82 00 08 0000 0000 20 0000 aa |! (. ... | 000001d0 29 82 8e fe ff ff 00 08 20 0000 f8 df 18 0000 |). | | 000001e0 0000 0000 0000 |. | 000001f0 0000 0000 0000 55 aa | .U. | 000002002, sure enough, it won't start: angry:3, CD repair.

Reference: https://blog.51cto.com/14012942/2434054

as everyone knows. Stage1.0-stage2.0 uses the almighty grub2-install (CentOS6's grub is too long, only grub-install)

Delete the things in the stage1.5 phase 1. The things in the stage1.5 phase are located in the partition behind the mbr of the disk and are used to load stage2

Stage2.0 is the kernel image, initramfs. Delete these two and reinstall the kernel with the omnipotent kernel. For more information, please don't delete them.

CentOS7 delete / boot/initramfsxxx.img and try CD rescue mode repair

CentOS7 delete vmlinuz to play.

CentOS7 delete boot directory to play.

Now destroy the contents of the disk after 512 bytes:

[root@localhost ~] # dd if=/dev/zero of=/dev/sda bs=1 count=10240 seek=512 # seek,oflag, skip the target file 512 bytes and then start 1024080 records in10240+0 records out10240 bytes (10 kB) copied, 0.0173931 s, 589 kB/s

After startup, you can't even see the grub interface.

2. Rescue mode rescue

A panacea for using stage stage repair: grub2-install

Refer to other people's blogs and take a look: https://www.cnblogs.com/mydba-j/p/10119498.html

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report