######### 系统恢复 #########
在虚拟机中操作。
(1)硬盘引导阶段,mbr 主引导记录的恢复
模拟硬盘损坏
[root@server ~]# fdisk -l 查看那446个字节在那盘上,发现是在/dev/vda 这块盘上
Disk /dev/vda: 8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a2a63
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 3074047 1024000 82 Linux swap / Solaris
/dev/vda3 3074048 16777215 6851584 83 Linux
[root@server ~]# dd if=/dev/zero of=/dev/vda bs=446 count=1 将446个字节拿走,虚拟机就会不能启动,硬盘损坏
1+0 records in
1+0 records out
446 bytes (446 B) copied, 8.2697e-05 s, 5.4 MB/s
[root@server ~]# getenforce 查看selinux ,要将selinux关闭,如果是 enforcing 强制级状态,需要将其改变为 disable,
Disabled
[root@server ~]# vim /etc/sysconfig/selinux 改变selinux 状态的目录,但是这个地方是不需要改的
[root@server ~]# reboot
模拟系统恢复
虚拟机已经打不开