grub rescue下如何手动引导ubuntu系统



grub rescue下如何手动引导ubuntu系统?把测试服务器的另外两块硬盘撤下,不能开机,又装上,发现启动不了ubuntu系统了,出现grub rescue的画面。现在让我们来学习手动来引导系统。

1、执行ls命令会出现所有的系统分区,如下
grub rescue> ls
(hd0,1),(hd0,2),(hd1,1),(hd2,1)
2、一个人ls查看,看能否看到/boot分区
grub rescue> ls (hd0,1)/
grub lost+found memtest86+_multiboot.bin vmlinuz-3.2.0-29-generic
config-3.2.0-29-generic initrd.img-3.2.0-29-generic memtest86+.bin System.map-3.2.0-29-generic
如果出现类似如上文件列表,表明此hd0,1为boot分区;如果出现unkonw system,继续ls下一分区。
3、设置root和prefix
grub rescue>set root=(hd0,1)
grub rescue>set root=(hd0,1)/grub
4、载入模块并启动
grub rescue>insmod /grub/normal.mod
grub rescue>normal
5、这时候顺利的话会成功引导进系统,下一步就是正常的修复grub了。
进入系统后,执行如下命令修复(以ubuntu为例)
sudo update-grub
sudo grub-install /dev/sda
注:/dev/sda根据bios设置的第一硬盘设置。如果重启之后还出现grub rescue,重复以上步骤,把sda换成其它硬盘,直到成功为止。