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
or:
# 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.
Are you adverse to just reinstalling? It's a fresh install like you said. If I were to try to fix it, I'd boot off a LiveCD, chroot in and attempt grub installation much like it sounds like you've attempted. That should work, maybe you're not chrooting correctly? – James T Snell – 2011-09-29T20:34:01.723
@Doc - It'd be nice if I didn't have to spend the ~2 hours again to reinstall it manually, but that may be my best bet. I found a tutorial on installing GRUB using the CD's installer environment, but it had a bad argument variable, and I've since forgotten where it was. Could you suggest how to chroot and install GRUB from an online repository? – Brandon Lebedev – 2011-09-29T21:07:58.000
Okay Brandon, I gave ya about the best answer I can without doing a bunch of investigating.. Not sure I'd learn anything more anyway, as once I learned as below, I didn't seem to need more for dealing with messed up booting. The whole chrooting thing was taught to me by the Gentoo Handbook - Gentoo's a pretty educational distro to run, and their docs are astonishingly good. – James T Snell – 2011-09-29T22:25:09.960