磁盘引导文件出错
错误原因
dd if=/dev/zero of=/dev/vda bs=446 count=1
reboot
需要在虚拟机shut off时,开始配置
修正
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,系统会自启动
磁盘引导文件丢失
错误原因
rm -rf /boot/grub2/grub.cfg
reboot
修正
内核启动文件丢失
错误原因
rm -rf /boot/vmlinuz-3.10.0-123.el7.x86_64
reboot
修正
内核初始化文件丢失
错误原因
rm -rf initramfs-3.10.0-123.el7.x86_64.img
reboot
修正
进入光驱启动
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
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。