First, grab a copy of the latest Ubuntu LiveCD and boot it.html
$ sudo fdisk -llinux
$ sudo mount /dev/sda1 /mntweb
$ sudo mount /dev/sda2 /mnt/bootubuntu
$ sudo mount /dev/sda3 /mnt/var Make sure you don't mix these up, pay attention to the output of FDISKide
$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys工具
$ sudo chroot /mntpost
$ update-grubui
You should be chroot'd into your system as root, you can now run commands as root, without the need for sudo.this
Now you need to edit the /etc/default/grub file to fit your systemspa
$ nano /etc/default/grub
When that is done you need to run update-grub to create the configuration file. If you have a separate /boot partition you need to mount it first!
$ update-grub
To install GRUB 2 to the MBR, next you need to run grub-install /dev/sda
$ grub-install /dev/sda
If you encounter any errors, try grub-install --recheck /dev/sda
$ grub-install --recheck /dev/sda
$ sudo umount /mnt/dev
$ sudo umount /mnt/sys
$ sudo umount /mnt/proc
$ sudo umount /mnt
If you had alternate OS entries, update-grub might say "Cannot find list of partitions!". Ignore it and continue - once you can boot into your linux installation, do so and then rerun update-grub and grub-install /dev/sda as root.
Fire up a terminal from the Live CD for Ubuntu 10.04.
$ sudo fdisk -l (Note the partition number on which Linux resides)
$ sudo mount /dev/sdaX /mnt (Replace X with the partition number housing Linux)
$ sudo grub-install --root-directory=/mnt/ /dev/sda
$ sudo update-grub
$ sudo reboot
Credits to
http://mundogeek.net/archivos/2009/12/08/recuperar-grub-2/ for the enlightening post &
http://www.webupd8.org/2009/12/how-to-recover-grub2-linux.html for the awesome translation.
重點推薦 Ubuntu Grub2 徹底手冊:https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202