Solved. Here are step-by-steps instructions for a noob like me.
- First step after going to grub recovery is to find out the partition on the disk.
a) type "ls" on the grub-recovery prompt. this would give you all the partitions on your disk.
grub-recovery> ls
my output was
(hd0), (hd0,msdos1), (hd0,msdos2), (hd0,msdos3).... and so on
2) now we have to find out which of these partitions contain Ubuntu files to do this type
ls e.g. ls (hd0,msdos5)
in case you see and error it means that this is not the partition that we are looking for. Keep trying this with other partitions till you see something like below
e.g. lost+found dev bin usr etc-2
for me it turned out to be (hd0,msdos5)
3) now we need to find the location for the file with name starting with vmlinuz.... and initrd...
they would be generally under the folder /boot
ls /boot/
note down the full names and the path of the files, we might need them later. For me they we under /boot/ folder and were named vmlinuz-3.2.0-32-generic and initrd-3.2.0-32-generic
4) now make a Live CD or pen-drive for linux, plug it in and start your PC. When you see grub menu (menu where user is asked to either install Ubuntu or try it without installing) press character C
and hit enter.
this would take you to the grub prompt.
How to install Ubuntu via pen-drive
we are not going to make a fresh install of Ubuntu, we just want to use the grub command prompt.
5) type the below mentioned commands on grub prompt
set root=(hd0,x)
if your partition was sda5 type 5 in place of x e.g. set root=(hd0,5)
6) linux /vmlinuz root=/dev/sdXY ro
in case you see an error you'll have to use the full path that we notoed in step 3.
e.g. linux /boot/vmlinuz-3.2.0-32-generic root=/dev/sda5 ro
7) initrd /initrd.img
if you see an error specify the full path as in step E
e.g. initrd /boot/initrd.img-3.2.0-32-generic
8) boot
using the above methods I was able to boot into Ubuntu and was able to access all my data.
9) as final step we need to fix the grub so that we don't have to follow these steps every time we want to login.
Link to install Boot-Repair