There are two method that I often use to fix the grub on ubuntu, on time after installing windows including,
First Method
- Boot into a LiveCD (recomanded Ubuntu 9.04)
- Open a terminal
- Open the GRUB Command-line utility by typing
sudo grub
- Find where Grub is. If this gives a few different answers then you will need to find the correct one, perhaps by trial-and-error.
find /boot/grub/stage1
- Tell GRUB which partition to tell the MBR your Grub is on by entering
root (hdA,B)
- The coordinates A,B are where 'A' is the hard-drive number, starting at 0, and 'B' is the partition number, starting at 0. For example, if Ubuntu was installed on the second partition of the first hard-drive, the command should be
root (hd0,1)
- Tell GRUB which drive's MBR to fix
setup (hd0)
- Replace 0 only in the extremely unlikely event that your bios does not use the first hard-drive as the boot device. Typically Ubuntu might be on any drive but the bios will almost always go to the first drive's MBR to find out where to find the boot-loader.
- Leave the GRUB Command line
quit
- And reboot.
If that method still dont work, you should try
Second Method
- Insert the Ubuntu CD (for recomanded Ubuntu 9.04) select live CD
- Once inside the desktop, open Terminal
- Check the Linux root partition is where the command
sudo fdisk-l
- Once the device is known Linux root partition, suppose I have a /dev/sda6 and then type
sudo mount-t ext4 /dev/sda6 /mnt/
sudo mount-t proc proc /mnt/proc/
sudo mount-t sysfs sys /mnt/sys/
sudo mount-o bind /dev/ /mnt/dev/
sudo chroot /mnt/bin/bash
- Install Grub on MBR command
grub-install /dev/sda
- Install grub on linux partition
grub-install /dev/sda7
- after all is finished please restart.