您好,登錄后才能下訂單哦!
眾所周知bootloader位于磁盤(pán)前446字節(jié),屬于stage1.0階段
磁盤(pán)512字節(jié)后有一段空間是stage1.5階段,用于找到啟動(dòng)的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都用萬(wàn)能的grub2-install(CentOS6的grub太久,只能grub-install)
stage2.0就是內(nèi)核鏡像,initramfs,刪這兩個(gè)就用萬(wàn)能的重新安裝內(nèi)核即可,參考(沒(méi)事別亂刪):
CentOS7刪除/boot/initramfsxxx.img并嘗試光盤(pán)救援模式修復(fù)
CentOS7刪vmlinuz玩
CentOS7刪boot目錄玩
現(xiàn)在破壞磁盤(pán)512字節(jié)后的內(nèi)容:
[root@localhost ~]# dd if=/dev/zero of=/dev/sda bs=1 count=10240 seek=512 #seek,oflag,跳過(guò)目標(biāo)文件512字節(jié)再開(kāi)始
10240+0 records in
10240+0 records out
10240 bytes (10 kB) copied, 0.0173931 s, 589 kB/s
啟動(dòng)后連grub界面都看不到
使用stage階段修復(fù)的萬(wàn)能法寶:grub2-install
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。