修復被 windows 幹掉的 grub (ubuntu 10.04)

先安裝好 winsows 後再安裝 ubuntu, ubuntu 的 grub 預設會寫到 mbr 裡,所以可以做 windows 和 linux 的雙重開機,可是 windows 常常需要重新安裝,重新安裝 windows 的時候 mbr 一定會被 windows 吃掉,這時候只要修復一下即可,步驟如下

用 ubuntu 的光碟開進 live cd 模式
開啟終端機輸入

sudo -i
mkdir mnt
mount /dev/sda2 mnt
mount --bind /dev/ mnt/dev
mount --bind /proc/ mnt/proc
chroot mnt/
grub-install /dev/sda

重開機即可

p.s ubuntu 的 / 裝在 sda2 裡,/boot 也在 sda2,如果 boot 有獨立的 partition 記得在 chroot 前要先 mount 起來。

繼續閱讀...

  © Blogger template 'Minimalist G' by Ourblogtemplates.com 2008 Modified By Hugh

Back to TOP