您的位置:首页 > 其它

双系统重装windows后,修复grub启动

2012-12-10 09:11 543 查看
xp+ubuntu 12.04双系统,重装xp为win7,装好win7后恢复ubuntu的启动项。

《百度一下,你就知道》http://hi.baidu.com/shuye216/blog/item/2694891e3ef6ae094134173f.html

应用LiveCD启动光盘选择“试用而不安装”,进入后打开终端:

1、sudo fdisk -l

找到 id=83 选项,获取ubuntu的分区。

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x91c6943c

Device Boot Start End Blocks Id System
/dev/sda1 * 63 102414374 51207156 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sda2 102414436 597938175 247761870 f W95 Ext'd (LBA)
Partition 2 does not start on physical sector boundary.
/dev/sda3 597938176 776771583 89416704 83 Linux
/dev/sda4 776774880 976768064 99996592+ 83 Linux
/dev/sda5 102414438 348176744 122881153+ 7 HPFS/NTFS/exFAT
Partition 5 does not start on physical sector boundary.
/dev/sda6 348176808 593939114 122881153+ 7 HPFS/NTFS/exFAT
/dev/sda7 593940480 597938175 1998848 82 Linux swap / Solaris

2、sudo -i

3、mount /dev/sda2 /mnt

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

5、grub-install --root-directory=/mnt /dev/sda

6、重启
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: