Chinaunix首页 | 论坛 | 博客
  • 博客访问: 230411
  • 博文数量: 32
  • 博客积分: 2318
  • 博客等级: 大尉
  • 技术积分: 298
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-14 01:07
个人简介

新博客: http://qinchuan.me

文章分类
文章存档

2012年(2)

2011年(7)

2010年(6)

2009年(8)

2008年(9)

分类: LINUX

2011-09-06 16:13:10

If the MBR (Master Boot Record) of your computer's disk has been overwritten. Your computer won't boot up.

This notes explains how to set up the MBR to point to the original grub. [with new grub2]

Here are the general steps:

  1. Boot from Ubuntu Live CD
  2. Figure out which partition holds your GRUB boot
  3. Recover MBR
  4. Add new version of Windows to GRUB

Following are the steps in details.

Find your Ubuntu 10.04 Live CD and Boot from it

Self-explanatory. In theory, any live CD that uses Grub 2 should work.

Figure out boot partition

Using a partition editor, you can review the available partitions and remind yourself the name of the partition where the boot is located. On the Ubuntu Live CD, “gparted” is the command. It is available under the System > Administration menu.

You can add “gparted” in a Debian-based system with the following command:

sudo apt-get install gparted

Restore Master Boot Record (MBR)

Run the following commands, substituting with the correct partition names:

sudo -i
mount /dev/sda3 /mnt
mount /dev/sda2 /mnt/boot  #skip this one if not have a separate /boot partition
grub-install --root-directory=/mnt/ /dev/sda

After this, remove Live CD, close tray and reboot. The original grub2 should load.

Add Windows to Grub2

Re-running the “update grub” should allow grub2 to discover Windows:

sudo update-grub

That should do it. Good luck.

Original article:

See also:

阅读(1638) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~