Grub Rescue> Prompt [Solved]

November 2, 2011

When trying to boot a friend’s notebook that had had a faulty install on it, all I could get was a Grub Rescue> prompt which takes very few commands. Here’s the recipe I followed to get the notebook to boot into something useful.

Grub is throwing a wobbly because it can’t find your boot files – you need to find them first.

"The Grub folder containing the modules must be located so the correct modules can be loaded. This folder would have been created during the initial installation of Ubuntu and should be located in the Ubuntu partition. This folder would normally be located at either (hdX,Y)/boot/grub or (hdX,Y)/usr/lib/grub/i386-pc"

You can find where yours are located using ls

Code:

ls # List the known drives (hdX) and partitions (hdX,Y)
ls (hdX,Y)/ # List the contents of the partition's root
ls (hdX,Y)/boot/grub # Normal location of the Grub 2 modules.
ls (hdX,Y)/usr/lib/grub/i386-pc # Alternate location of the Grub 2 modules.

Mine turned out to be at (hd0,msdos1)/usr/lib/grub/i386-pc

So next give grub the right path:

grub rescue> set prefix=(hd0,msdos1)/usr/lib/grub/i386-pc
grub rescue> set root=(hd0,msdos1)

Now it knows where it’s modules are, run the normal one to get a better prompt

grub rescue> insmod normal
grub rescue> normal

The GRUB 2 menu should appear.

grub> insmod linux
grub> linux /vmlinuz root=/dev/sda1 ro
grub> initrd /initrd.img
grub> boot

These changes are not permanent. After successfully booting into the system you should run sudo update-grub and inspect the GRUB 2 configuration file (/boot/grub/grub.cfg).

For problems with booting the main linux kernel, ensure the search, linux, and initrd lines in the [### BEGIN /etc/grub.d/10_linux ###] section of the file now point to the correct locations.

You may need to reinstall GRUB 2 using sudo grub-install /dev/sdX.

Or using sudo apt-get remove Grub2
sudo apt-get install Grub2

Sources:

https://help.ubuntu.com/community/Grub2#GRUB%202%20Troubleshooting%20Preparation

http://ubuntuforums.org/showthread.php?t=1599293

  • 0

    Alternate Styling for Elements in PHP Loop

    June 22, 2011

    Handy wee bit of code for alternating the style on an element – for example to have different coloured rows in a table of for fitting box elements into a 2 column layout with a simple float left and putting a space between them by applying a margin-left style to alternate ones.

  • 0

    Exclude Categories from Slideshow

    June 7, 2011

    In home.php $q = new WP_Query( apply_filters(‘arras_slideshow_query’ ,$query) ); replace with $q = new WP_Query( apply_filters(‘arras_slideshow_query’,'cat=-4′ ,$query) ); Where 4 is the id of the category you want to exclude, if you have multiple categories you want to exclude, say 4, 5 and 6 then: $q = new WP_Query( apply_filters(‘arras_slideshow_query’,'cat=-4,-5,-6′ ,$query) );

  • 0

    Remove ‘Category’ from URL Path

    June 1, 2011

    To remove /category/ from the url: 1. Go to Settings >> Permalinks and select Custom and enter: /%category%/%postname%.html 2. Next set your Category Base to /. Save it and you’ll see your URL changed to this format: 3. (If you have sub-categories as I do) Add this code into wp-includes/category-template.php line 836 // added to [...]

  • 2

    WordPress Slideshow On Category Pages

    May 18, 2011

    The theme Arras comes with a slideshow showing the latest images for news items at the top of the homepage. I wanted to replicate this on the category pages – but showing the latest images in that particular category. Open up archive.php and below where is says paste this