linux root------系统排错

磁盘引导文件出错

错误缘由linux

dd if=/dev/zero of=/dev/vda bs=446 count=1
reboot

须要在虚拟机shut off时,开始配置
修正bash

virt-manager

添加光驱 
browse    7.0镜像
boot options 光驱优先级最高
-->apply
-->troubleshooting
-->rescue a hat hat enterprise linux system
-->continue
-->ok
-->ok
sh-4.2#df
sh-4.2#chroot /mnt/sysimage/
bash-4.2#grub2-install /dev/vda
bash-4.2#exit
sh-4.2#exit
进入硬盘启动

两次exit,系统会自启动app

图片描述
图片描述

磁盘引导文件丢失

错误缘由spa

rm -rf /boot/grub2/grub.cfg
reboot

修正
图片描述3d

内核启动文件丢失

错误缘由
rm -rf /boot/vmlinuz-3.10.0-123.el7.x86_64
reboot
图片描述code

修正
图片描述blog

内核初始化文件丢失

错误缘由
rm -rf initramfs-3.10.0-123.el7.x86_64.img
reboot图片

图片描述

修正get

进入光驱启动
chroot /mnt/sysimage/
mkinitrd /boot/initramfs-$(uname -r).img $(uname -r)
两次exit
进入硬盘启动
reboot

图片描述

systemd初始化文件连接出错

错误缘由:
[root@localhost Desktop]# ln -snf /usr/lib/systemd/system/poweroff.target /etc/systemd/system/default.target #默认程序软连接到关机程序上
[root@localhost Desktop]# reboot
图片描述虚拟机

修正:
上下按[e]
添加5
ctrl + x
[root@localhost Desktop]# systemctl set-default graphical.target
图片描述

忘记超级用户密码

上下按[e]
ctrl + x
ro及后面换成rw rd.break

switch_root:/# chroot /sysroot/
echo westos | passwd --stdin root
touch /.autorelabel
exit
exit

图片描述

相关文章
相关标签/搜索