GRUB error after imaging DELL 490

  • 7006480
  • 21-Jul-2010
  • 30-Apr-2012

Environment

Novell ZENworks 7.3 Linux Management - ZLM7.3

Situation

After imaging a DELL Precision Workstation 490, the system gets the error: grub error 2 after restoring the image. The workstation will not boot correctly due to this error. 

Resolution

"Out of sync" grub files were found in the image that caused this issue. After replacing these files with valid grub files (see explanation in Additional Information section), the following script corrected the problem in this case:
    img a
    mount /dev/sdXY /mnt/harddisk #(X can be a,b,c etc and Y can be 1,2,3 etc./dev/sdXY is the active partition)
    grub-install.unsupported --root-directory=/mnt/harddisk --recheck /dev/sdX #(X can be a,b,c etc) 

Additional Information

In this case, it was found that on image restoration, using the latest distribution (SLES11 based), grub files namely e2fs_stage1_5 and stage2 within the image were out of sync and hence it results in the grub error.  This most likely will not happen in most cases.

So to make these "out of sync" images work, the image(.zmg) file, was opened using image explorer, then took e2fs_stage1_5,stage2 and message file from the /boot folder of SLES11 OS, and then replaced these files with valid files and saved it.

Additionally once image restoration is complete, the active partition must be mounted running the command:

grub-install.unsupported --root-directory=/mnt/harddisk --recheck /dev/sdX #(X can be a,b,c etc) which will resolve the grub error.