Tuesday, September 14, 2010

reinstall grub on MBR

from ubuntu 9.10, grub 2 is installed by default.

if for some reasons, you installed windows after ubuntu on your machine, grub gone.

one of the ways to get your ubuntu back is reinstall grub on MBR. follow these steps
  • boot from an ubuntu livecd.
  • open terminal, type sudo -i
  • fdisk -l and find the partition where located linux
  • mkdir /media/root
  • mount /dev/sda(x) /media/root
  • grub-setup --root-directory=/media/root -m /media/root/boot/grub/device.map /dev/sda(x) 
run apt-get install grub-pc if needed.

No comments:

Post a Comment