Reinstall Ubuntu Grub

出自Full Circle 中文项目主页

跳转到: 导航, 搜索

文章第一部分

Reinstall Ubuntu Grub Bootloader After Windows Wipes it Out

在Windows把Grub覆盖后重新安装Ubutnu的Grub启动器
If you run a dual-boot system with Linux and Windows, this has happened to you. You had to do your monthly reinstall of Windows, and now you don’t see the linux bootloader anymore, so you can’t boot into Ubuntu or whatever flavor of linux you prefer.

如果你现在使用一个含有Linux和Windows的双系统,而这事刚好发生在你身上。你习惯于每个月重新安装Windows,但是现在却看不到linux的引导装置,所以你不能开机进入到Ubuntu或是任何你觉得独特的linux。

Here’s the quick and easy way to re-enable Grub.

下面是个快速简单重新启动Grub的方法。

1) Boot off the LiveCD

1) 从LiveCD启动

2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub “prompt”, and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

2)打开一个终端然后输入以下的命令,注意到第一条命令将会把你带入grub的“命令提示符”,接下来的三个名将会被用来在其中执行。同时注意hd,0指的是第一个硬盘驱动器的第一个分区,那里可能是你执行安装grub的位置。如果不是,就根据自己的情况调整。

   sudo grub
   find /grub/stage1
   > root (hd0,x)
   > setup (hd0)
   > quit 

Reboot (removing the livecd), and your boot menu should be back.

重新启动(取出livecd),你的启动菜单应该已经重新出现了。

文章第二部分

Only read below if Windows is now missing from the boot menu

如果Windows从启动菜单中消失了,接着往下看。

If you installed Ubuntu before you installed Windows, then Ubuntu will not have anything in the grub configuration for Windows. This is where you’ll have to do a bit of manual editing to the grub boot menu file.

如果你在安装Ubuntu之后又安装了Windows,那么Ubuntu的Grub中不会有任何Windows的配置信息。这时你就要手动对Grub的启动菜单文件进行一点小小的编辑。

If you open the file /boot/grub/menu.lst with the following command:

用以下命令打开/boot/grub/menu.lst文件:

   sudo gedit /boot/grub/menu.lst

You’ll see a sample section for Windows, which you’ll want to uncomment and add to the boot menu list in whatever position you want it in. (uncomment by removing the #’s)

这时你会(从此文件当中)找到一些关于Windows的示例部分,取消这一部分的注释,然后将它加入到启动菜单列表的合适位置中。(删除符号“#”就可以取消注释)

   # title   Windows 95/98/NT/2000
   # root   (hd0,0)
   # makeactive
   # chainloader   +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3)

注意确认 hd0,0 是Windows系统的正确位置,如果Windows安装在硬盘驱动器的第4个分区上,那么将其修改为(hd0,3)。

参看

个人工具