免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4055 | 回复: 0
打印 上一主题 下一主题

[桌面系统] ubuntu 重装win7后修复grub [复制链接]

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:55:28
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-04-08 11:31 |只看该作者 |倒序浏览
用ubuntu9.10以上(9.10以下的就是修复grub1(如不会,在我博客另一章里有介绍))的系统盘,启动光盘选择“试用而不安装”,进入后打开终端:

(注意命令间的空格,特别是mnt前面有空格)

补充/首先应该sudo fdisk -l   找到id=83的选项,如,我的是:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbbc20dd6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3891    31254426    7  HPFS/NTFS
/dev/sda2            3892        6261    19028992   83  Linux
/dev/sda3            6261       38914   262282241    f  W95 Ext'd (LBA)
/dev/sda4            6504       11727    41953280    7  HPFS/NTFS
/dev/sda5            6261        6504     1952768   82  Linux swap / Solaris
/dev/sda6           11727       24794   104960000    7  HPFS/NTFS
/dev/sda7           24794       38914   113414144    7  HPFS/NTFS
,这样获取自己ubuntu分区在/dev/sda2。

然后再按照以下去做

1. sudo -i

2. mount /dev/sda2 /mnt

3. mount /dev/sda2 /mnt/boot   这一步是有给 /boot 单独分区的命令,若没单独分区跳过这步

4. grub-install --root-directory=/mnt/ /dev/sda

5. 重启

6. 机子重启后就进了grub界面,但没进grub菜单,所以又有下面的步骤,在grub>提示符下输入:

7. find /boot/grub/core.img (若boot单独分区则:find /grub/core.ima)
此命令会得到个结果:(hdx,y)

8. root (hdx,y)

9. kernel /boot/grub/core.img
(boot单独分区则:kernel /grub/core.img)

10. boot
执行该命令后就转入到GRUB菜单,此时选择进入Ubuntu

11. 在ubuntu下启动终端

12. sudo grub-install /dev/sda
此命令用作修复grub,

经过上面的步骤就就能恢复到原来的双系统。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP