Friday 26 April 2019

Ubuntu 11.04 (64-bit) won't boot. Forgot to install GRUB 2. Manual GRUB install fails


I cannot get Ubuntu to boot. I downloaded the Ubuntu 11.04 64-bit mini.iso and installed it in Virtualbox (v.4.1.2 running on OS X 10.5.8). When I installed Ubuntu, I selected "Command-line expert install", and I may have made two mistakes:



  1. I chose to install the generic virtual kernel.

  2. I didn't install a boot loader.


The installation finished, and when I reboot, I get this blank black screen with an arrow that doesn't flash


enter image description here


I think this happens because GRUB was not installed. (If I hold down SHIFT or E during boot, nothing comes up. update-grub also doesn't work.) I tried installing grub using sudo aptitude install grub-pc, but that returned several error messages:


screen capture of sudo aptitude #1


screen capture of sudo aptitude #2


Could someone please help me get Ubuntu to boot? I can post more details if they are helpful.



Answer



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.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...