1.插入ubuntu的光盘,重新启动系统。
2.选择试运行ubuntu.即第一个选项。
3.进入系统后,打开terminal,依次输入:
sudo fdisk -l
将显示:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70f7ab9c
Device Boot Start End Blocks Id System
/dev/sda1 1 1627 13060096 27 Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda2 * 1627 1639 102400 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 1639 8166 52429859 7 HPFS/NTFS
/dev/sda4 8167 38913 246975277+ 5 Extended
/dev/sda5 8167 32385 194539082+ 7 HPFS/NTFS
/dev/sda6 32386 38788 51432066 83 Linux
/dev/sda7 38789 38913 1004031 82 Linux swap / Solaris
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x51feaaf5
Device Boot Start End Blocks Id System
/dev/sdb1 1 19457 156288321 7 HPFS/NTFS
找到ID为83的那行,记住 /dev/sdaX的情况,比如本人的电脑是/dev/sda6
3.然后依次输入:
sudo -i (用于取得root权限)
mkdir /media/tempdir (在media目录下创建tempdir文件夹)
mount /dev/sda6 /media/tempdir(将sda6挂载于tempdir下)
grub-install --root-directory=/media/tempdir /dev/sda(此步最重要)
随后即可见到:Installation finished.No Error Reported.说明成功引导。重启即可。