Linux vps Grub rescue 引导项修复

买了个dedicontrol 的VPS,重装个系统开机,直接进入grub 进不了系统,再重装也进不了。 :sweat_smile: :sweat_smile: :sweat_smile:

grub恢复出了几个错误:‘insmod normal no such partition’,‘unknown filesystem’ 后来才知道少了个:‘set root’

一、找到系统分区安装所在盘 用ls命令查找,我的在最后一个

grub rescue> ls
(hd0)  (hd0,msdos1)  (hd1)  (hd1,msdos2)  (hd1,msdos1) 

二、继续输入命令,vps救援模式不能复制粘贴,老老实实输入

grub rescue> root=(hd1,msdos1) 
grub rescue> prefix=/boot/grub
grub rescue> set root=(hd1,msdos1) 图上我输错了一步
grub rescue>  set prefix=(hd1,msdos1)/boot/grub
grub rescue>  insmod  normal
grub rescue>  insmod  此命令会重启选择系统

fix

三、重启后选择系统进入

安装grub到efi分区

df  找到你的efi分区挂载点
grub-install /dev/sdb2