Here's my approximate notes on how I chroot in and play with grub stuff:
Step 1) Boot from a LiveCD, I prefer USB drives to CDs.. Just be sure the LiveCD is as close as possible to the installed environment.... It certainly needs to be the same general architecture (x86 versus x64). You can get in to other weirdness if the live environment is otherwise sufficiently different too.
Step 2) Mount your ubuntu installation's root partition to /mnt:
# sudo mount /dev/sda1 /mnt
Obviously your root partition may not be on /dev/sda1 - if you're unsure, use fdisk or gparted to figure out where it is.
If you intended to have a boot partition, you'll want to mount that too:
# sudo mount /dev/sdaX /mnt/boot
Step 3) Get networking going, under the live environment. Ping google.com or something to confirm you've got connectivity.
After you've got networking going, you'll need to copy your DNS settings over to your installed environment before chrooting:
# sudo cp /etc/resolv.conf /mnt/etc/
Get ready to chroot:
# sudo mount -o bind /proc /mnt/proc
# sudo mount -o bind /sys /mnt/sys
# sudo mount -o bind /dev /mnt/dev
Step 4) Chroot in to the installed environment:
# sudo chroot /mnt /bin/bash
Step 5) Test that things are working. Try to ping google again - if it works, now your 'installed' environment can be totally played with. If they're not working, umm, maybe go back over the steps and make sure you did them correctly - or post a comment...
Step 6) Install Grub:
# sudo apt-get update; sudo apt-get install grub-pc
Step 7) Try rebooting and check things out. If you're still out of luck, you can re-enter your installation via chroot and try more things... Such as below..
Still having problems? You may want to manually run stuff such as:
# sudo dpkg-reconfigure grub
# sudo grub-update
IF you're still having problems, try installing "boot-repair":
# sudo add-apt-repository ppa:yannubuntu/boot-repair
# sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair
More about boot-repair here.
Other Helpful Stuff
I often suggest people check out Super Grub Disk, it's pretty epic for booting otherwise messed up set ups.
For those multi-booting with Windows Vista or Windows 7, I often like suggest checking out EasyBCD - it provides a really snazzy means of managing booting. And I've found it helpful for getting an otherwise under-cooperative system booting again. I gotta hand it to them, I like EasyBCD over grub, for now. Note there's a free version there.
There ya go, hope that helps.. Here's where I first really learned about chrooting, which, as you can see, is very very powerful and handy.