Tuesday, June 18, 2013

grub fails returning "stage1 not read correctly"


grub stage1 not read correctly
/boot/grub/stage1 was not read correctly
 
This message is usually obtained during procedures that grub requires to read its configuration files but it was not able to parse them adequately although they are found.

There are many possible reasons.
First check your grub version.

Partition of ext4 type requires grub2 and it will cause this message.

For instance, Debian 7 (wheezy) installation uses grub2 and if you trying to reinstall grub using prior version the parsing incompatibility will cause the message. Other Debian based distributions will certainly run that way.
So, try the procedures below, but without warranty at all.
They work pretty well for me, and are frequently used.



Installing grub2

Follow the procedure as root.

1. Check if the environement already has a previous grub command.

grub --version
if it returns a message, probably is grub1, which returns something like ... 0.97.
grub1 which does not work with ext4 .


To check grub2, do:

grub-install --version
$grub-install (GRUB) 1.99-27+deb7u1


2. Remove the old version if installed:

sudo apt-get purge grub


3. Install the grub2 version:

sudo apt-get install grub2
apt-get install grub2


4. Test the installation:

grub-install --version
$grub-install (GRUB) 1.99-27+deb7u1


Restoring boot

Partition resizing or another operation may invalidate the boot.
In this case it is necessary to restore the grub configuration.

Two alternatives:
- using command line.
- using the Debian's recue interface.
  

Method #1 - using command line.

Boot the machine from "Debian's Installation CD or DVD".
It doesn't matter if from .iso file, virtual machines,  CD or DVD.
Go to:

Advanced options, Rescue mode
Device to use as root file: /dev/sda5
Execute a shell in /dev/sda5


After you get access to the prompt, issue the following commands:


su
mount /dev/sda1 /boot
grub-install /dev/sda


Shall return a success message.

To exit, type exit twice.
Restart machine.


Method #2 - using the Debian's recue interface

Boot the machine from "Debian's Installation CD or DVD".
It doesn't matter if from .iso file, virtual machines,  CD or DVD.
Go to:

Advanced options, Rescue mode
Device to use as root file: /dev/sda5
Execute a shell in /dev/sda5

After you get access to the prompt, type exit.
It's gonna appear a dialog to reinstall grub.
Use it.
Restart machine.


More about grub

Additional information like grub's notation, the documentation of prior version (grub1) is still usefull.





No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...