Restore GRUB quite simple in Ubuntu, instead going through all the “gain root access” and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
- Boot your computer up with Ubuntu CD
- Go through all the process until you reach “[!!!] Disk Partition”
- Select Manual Partition
- Mount your appropriate linux partions
- DO NOT FORMAT THEM.
- Finish the manual partition
- Say “Yes” when it asks you to save the changes
- It will give you errors saying that “the system couldn’t install …..” after that
- Ignore them, keep select “continue” until you get back to the Ubuntu installation menu
- Jump to “Install Grub ….”
- Once it is finished, just restart your computer
Another way to restore GRUB, for advance users.
- Pop in the Live CD, boot from it until you reach the desktop.
- Open a terminal window or switch to a tty.
- Type “grub”
- Type “root (hd0,6)”, or whatever your hard disk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
- Type “setup (hd0)”, or whatever your hard disk number is.
- Quit grub by typing “quit”.