unit 11系统恢复技术

系统启动流程
1.
通电

2.bios(
主板上的只读存储中,basic input or output system)
 
作用,硬件检测,**硬件


3.grub
系统引导(grub引导分为两个阶段)
1
)阶段1磁盘引导阶段
mbr
(主引导记录)主引导记录在硬盘上的0磁道,一扇区,446个字节
   dd if=/dev/zero of=/dev/vda bs=446count=1
可以清空mbr
   reboot
重启

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

   force off-->add hardware-->devicetype(CDROM)browse(镜像所在位置),finish-->boot options-->boot device order(选中CDROM,并将CDROM置顶),apply-->poweron-->选择troubleshooting-->选择rescue a red hat enterprise linux system

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

   进入到挽救模式,执行chroot/mnt/sysimage切换到真实/环境

Linux--RH134---unit 11 系统恢复技术
  
并执行grub2-install/dev/vda

Linux--RH134---unit 11 系统恢复技术
   
selinux设为disabled

Linux--RH134---unit 11 系统恢复技术
   force off-->boot options-->bootdevice order(
CDROM置末),apply-->poweron


2
)阶段2 grub文件引导阶段
  
找到/boot分区

Linux--RH134---unit 11 系统恢复技术
  
读取/boot/grub2/grub.cfg

Linux--RH134---unit 11 系统恢复技术
  
文件丢失,grub2-mkconfig>/boot/grub2/grub.cfg
Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

Linux--RH134---unit 11 系统恢复技术

4.启动内核,只读挂载/设备
检测硬件设备
对设备驱动进行初始化
/只读挂载
进入系统初始化阶段
内核丢失,从新安装内核安装包就可以解决

rm -r vmlinuz-3.10.0-123.el7.x86_64
reboot
重启

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

force off-->boot options-->boot device order(CDROM置顶),apply-->power on-->选择troubleshooting-->选择rescue a red hat enterprise linux system

进入到挽救模式,执行chroot /mnt/sysimage切换到真实/环境

执行mount /dev/cdrom/ /mnt/
cp /mnt/Packages/kernel-3.10.0-123.el7.x86_64.rpm /root/
rpm2cpio kernel-3.10.0-123.el7.x86_64.rpm | cpio -id
cp vmlinuz-3.10.0-123.el7.x86_64 /boot/

Linux--RH134---unit 11 系统恢复技术
force off-->boot options-->boot device order(
CDROM置末),apply-->power on

5.
系统初始化阶段
系统初始化阶段加载initrd镜像

rm -fr initramfs-3.10.0-123.el7.x86_64.img
reboot
重启

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

force off-->boot options-->boot device order(CDROM置顶),apply-->power on-->选择troubleshooting-->选择rescue a red hat enterprise linux system
进入到挽救模式,执行chroot /mnt/sysimage切换到真实/环境
执行mkinitrd /boot/initramfs-$(uname -r).img $(uname-r)

Linux--RH134---unit 11 系统恢复技术
force off-->boot options-->boot device order(
CDROM置末),apply-->power on

6.
开启初始化进程systemd
开始selinux
加载内核参数
初始化系统时钟,键盘,主机名称
重新读写挂载/设备
**raidlvm
**配额
启动multi-user.target.wants中的所有服务
开启虚拟控制台
启动图形

恢复图形
rm -fr /etc/systemd/system/default.target
ln -s /usr/lib/systemd/system/poweroff.target/etc/systemd/system/default.target
reboot
重启

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

在如下界面按e

Linux--RH134---unit 11 系统恢复技术
进入下图所示界面,将ro后面所有改为rw rd.break,更改完成后,按ctrl+x

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

chroot /sysroot/
ls /etc/systemd/system/default.target -l
rm -fr /etc/systemd/system/default.target
ln -s /usr/lib/systemd/system/graphical.target/etc/systemd/system/default.target
Linux--RH134---unit 11 系统恢复技术
改密码
在如下界面e

Linux--RH134---unit 11 系统恢复技术
进入下图所示界面,将ro后面所有改为rw rd.break,更改完成后,按ctrl+x

Linux--RH134---unit 11 系统恢复技术
Linux--RH134---unit 11 系统恢复技术

chroot /sysroot/
passwd
touch /.autorelabel
Linux--RH134---unit 11 系统恢复技术 

相关文章:

  • 2021-06-24
  • 2022-01-16
  • 2021-12-04
  • 2021-09-28
猜你喜欢
  • 2022-01-16
  • 2021-09-08
  • 2021-08-02
  • 2021-04-02
  • 2021-12-16
相关资源
相似解决方案