When you install some operating sysems such as windows, they will overwrite your master boot record. If you have Ubuntu installed you will be unable to access it, until you restore Grub on MBR.
The easiest way is to find your Ubuntu CD and boot it. Open a terminal and find which partition is your root using fdisk.
/dev/sda1 * 1 6375 51200000 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 6375 19123 102400000 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 19123 24222 40962048 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4 24223 30401 49631937+ f W95 Ext'd (LBA)
/dev/sda5 24223 29806 44847104 83 Linux
/dev/sda6 29806 29932 1008640 82 Linux swap / Solaris
/dev/sda7 29932 30057 1009664 82 Linux swap / Solaris
Here we see that /dev/sda5 is your Linux Partition, so we will to mount it in order to read the Grub configuration.
Now to restore the configuration just write the following.
The easiest way is to find your Ubuntu CD and boot it. Open a terminal and find which partition is your root using fdisk.
sudo fdisk -lDevice Boot Start End Blocks Id System
/dev/sda1 * 1 6375 51200000 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 6375 19123 102400000 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 19123 24222 40962048 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4 24223 30401 49631937+ f W95 Ext'd (LBA)
/dev/sda5 24223 29806 44847104 83 Linux
/dev/sda6 29806 29932 1008640 82 Linux swap / Solaris
/dev/sda7 29932 30057 1009664 82 Linux swap / Solaris
Here we see that /dev/sda5 is your Linux Partition, so we will to mount it in order to read the Grub configuration.
sudo mount /dev/sda5 /mntIf your don't get any errors now your root partition should be mounted under /mnt.
Now to restore the configuration just write the following.
sudo grub-install --root-directory=/mnt /dev/sdaThis will install Grub to MBR and use the configuration files in /mnt/boot/grub. Then update grub with this code :
sudo update-grubNow just reboot the computer and you will hopefully be greeted with the ever friendly Grub menu once again.