Rescuing Grub after Ubuntu server upgrade

Recently, I had to upgrade a server which was running Ubuntu 10.04-server image to Ubuntu 12.04. I have upgraded Ubuntu server once before and it went really smoothly. So, I thought this will be over in a jiffy but, as luck would have it, this time something else was in store for me. Now, the recommended way to go about upgrading an Ubuntu server is:

sudo apt-get update

sudo apt-get upgrade

sudo do-release-upgrade

You can read more about tips on how to upgrade Ubuntu server here –> http://askubuntu.com/questions/203301/how-to-safely-upgrade-from-an-older-ubuntu-version-to-a-newer-one

Everything was going smoothly, texts were scrolling rapidly in the terminal, I got the prompt to enter mysql password, whether I wanted old config files or new ones. I did get a window that popped up with nothing but  square shaped letters.  But, in the end I got the message that the Ubuntu upgrade has been completed sucessfully and I needed to reboot the machine and so I complied. But, the moment machine rebooted, instead of getting the grub screen I got an error “Error: Symbol ‘grub_xputs’ not found” and I was landed in a grub rescue prompt. To be honest, I have never faced an issue like this before, so I googled for solutions and in the end I found it nicely laid out here –> http://ubuntuforums.org/showthread.php?t=1581099

I had two hard drives, one with / on it and other with /home and Ubuntu was the only operating system on it. Once I was in the Live mode, I downloaded the bootinfoscript and ran it to make sure that I had no inconsistency. Next, I needed to locate the drive containing /, which for me was /dev/sda1. After locating the drive, these commands which are from the link mentioned above, did the trick for me:

sudo mount /dev/sda1 /mnt    #as /dev/sda1 had my / partition

sudo grub-install --root-directory=/mnt /dev/sda

After entering these commands in the terminal when I rebooted, I was greeted with the familiar grub screen. In the end, everything went better than expected and yet another learning experience.

everythingwentbetterthanexpected~Later~

Sugandh

Advertisements

One thought on “Rescuing Grub after Ubuntu server upgrade

  1. Pingback: Another server upgrade….another problem!!! | insideLOSS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s