您好,登錄后才能下訂單哦!
眾所周知bootloader位于磁盤前446字節,屬于stage1.0階段
磁盤512字節后有一段空間是stage1.5階段,用于找到啟動的img和vmlinuz
眾所周知,stage1.0-stage2.0都可以用grub2-install(CentOS6是grub-install)
參考:https://s4.51cto.com/wyfs02/M02/87/20/wKiom1fVBELjXsvaAAUkuL83t2Q304.jpg
[root@localhost ~]# dd if=/dev/zero of=/dev/sda bs=1 count=446
446+0 records in
446+0 records out
446 bytes (446 B) copied, 0.000932527 s, 478 kB/s
[root@localhost ~]# hexdump -C -n 512 /dev/sda
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 20 |............... |
000001c0 21 00 83 aa 28 82 00 08 00 00 00 00 20 00 00 aa |!...(....... ...|
000001d0 29 82 8e fe ff ff 00 08 20 00 00 f8 df 18 00 00 |)....... .......|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
參考:https://blog.51cto.com/14012942/2434054
眾所周知。stage1.0-stage2.0都用萬能的grub2-install(CentOS6的grub太久,只能grub-install)
stage2.0就是內核鏡像,initramfs,刪這兩個就用萬能的重新安裝內核即可,參考(沒事別亂刪):
CentOS7刪除/boot/initramfsxxx.img并嘗試光盤救援模式修復
CentOS7刪vmlinuz玩
CentOS7刪boot目錄玩
現在破壞磁盤512字節后的內容:
[root@localhost ~]# dd if=/dev/zero of=/dev/sda bs=1 count=10240 seek=512 #seek,oflag,跳過目標文件512字節再開始
10240+0 records in
10240+0 records out
10240 bytes (10 kB) copied, 0.0173931 s, 589 kB/s
啟動后連grub界面都看不到
使用stage階段修復的萬能法寶:grub2-install
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。