Centos7误删除grub文件进行修复
步骤一、模拟误删故障
1.删除grub2
[root@test ~]# rm -rf /boot/grub2 2.重启计算机
[root@test]# reboot
步骤二、救援模式,使用命令修复
1.进入bios设置光盘为第一启动项
2.选择cd-rom
3.选择 troubleshooting
4.选择 rescue
5.选择continue
你的系统根目录,挂载到了/mnt/sysimage 下面
/etc/passwd 磁盘上面的 /mnt/sysimage/etc/passwd
#切换当前的根
chroot /mnt/sysimage
6.进入救援模式使用grub2-install、grub2-mkconfig恢复配置文件
sh-4.2# grub2-install /dev/sda
sh-4.2# grub2-mkconfig -o /boot/grub2/grub.cfg
步骤三、Ctrl+d,然后reboot重启
Centos7误删除grub2文件进行修复
最新推荐文章于 2024-05-10 06:53:44 发布