最近,我安装了Ubuntu 10.10,并在安装时选择了错误的选项。
现在的问题是我的机器直接启动Ubuntu,甚至没有显示grub菜单。
如何安装grub菜单?
以及如何将Windows Vista添加到grub菜单?
这就是我尝试过的。
sudo grub
> root (hd0,0)
> setup (hd0)
Error 17: Cannot mount selected partition
我不知道这里出了什么问题,而且我确定自己还没有清除Windows分区。
编辑 :
sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found memtest86+ image: /boot/memtest86+.bin
ls: cannot access /media/BC54B2C654B282A6/boot
Boot: No such file or directory
done
sudo os-prober
ls: cannot access /media/BC54B2C654B282A6/boot
Boot: No such file or directory
谢谢。
我尝试使用sudo update-grub
,sudo os-prober
但没有运气。
这就是我所做的。
sudo gedit /etc/default/grub
并在行前添加注释#GRUB_HIDDEN_TIMEOUT=0
。
然后,我更新了grub,这样我就不必使用左移来显示grub了sudo update-grub
。
更新grub之后,我使用sudo gedit /boot/grub/grub.cfg
命令打开了grub.cfg 。
并添加
menuentry "Windows Vista" {
set root='(hd0,1)'
chainloader +1
}
在### BEGIN /etc/grub.d/40_custom ###
和之间### END /etc/grub.d/40_custom ###
并且不要忘记保存文件。
我将此答案标记为Community Wiki,以防有人想要添加或修改此帖子。
编辑以更新:
同时(2013)我们提供了一个GUI工具来修复/重新安装grub:Boot Repair。
要使用它,请执行以下一项操作:
创建Ubuntu Secure Remix的实时CD / USB ,这是一个带有辅助救援工具的Ubuntu live,从其启动并使用Boot Repair。
如果您已经有常规的Ubuntu live iso,请使用UNetbootin创建live usb,从中进行live boot并安装Boot Repair。
sudo add-apt-repository ppa:yannubuntu / boot-repair && sudo apt-get更新
sudo apt-get install -y引导修复&&引导修复&
(但是apt-get update
在实时USB上,更新可能会花费一些时间-如果实时USB不是持久性的,那么更新也将是无用的-因此,我建议使用第一种解决方案。)
使用Boot Repair修复/重新安装GRUB很简单,只需选择默认/推荐的修复选项即可;更多细节在这里。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句