拿起Ubuntu啟動光盤啟動進入試用Ubuntu,打開超級終端輸入命令
sudo fdisk -l #查看我ubuntu安裝的位置(我的是sda8)
sudo passwd root #設置root密碼不想的話可以sudo -i來獲取最高權限
mount /dev/sda8 /mnt #掛在ubuntu系統位置
grub-install --root-directory=/mnt /dev/sda #安裝grub出現‘Installation funished.NoError Reported.’表示成功
#下面的代碼可不用因為grub.cfg在sda8上面,我的boot是在ubuntu同一個盤的。如果不是的話就需要打下面的代碼來重新修復grub.cfg文件
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
chroot /mnt update-grub #這一步是必須的,目的在於更新Grub
umount ...(上面的各項)
exit
重啟。