SUSE Support

Here When You Need Us

How to manually install GRUB after a failed installation or disk corruption of the MBR

This document (7001376) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Desktop 10 Service Pack 2
SUSE Linux Enterprise Desktop 10 Service Pack 1
SUSE Linux Enterprise Server 10 Service Pack 2
SUSE Linux Enterprise Server 10 Service Pack 1
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9 Service Pack 4
SUSE Linux Enterprise Server 9 Service Pack 3
SUSE Linux Enterprise Point of Service

Situation

  • BIOS error message about no bootable drive
  • After first installation, server will not boot with BIOS error message

Resolution

This issue has been observed on some servers with CCISS devices and on some RAID cards. The "grub-install" script that shipped with SLES 10 SP2 incorrectly identifies the root device. If this happens, a manual installation of Grub may by required.

For this example, /dev/sda1 is the assumed /boot and /dev/sda2 is the assumed root partition.

LVM and EVMS users:

If you are using LVM, then the devices should be automatically seen. Type "lvscan" to make sure that your logical volumes have been detected.

For users using EVMS, the LVM volumes should be detected. You may use "lvscan" to find the volumes. Since the changes are being made to the /boot partition, LVM is not needed."

Procedure
 
  1. Mount root to /mnt. If root is on an LVM or EVMS device, use the LVM or EVMS name for the device
    mount /dev/sda2 /mnt
     
  2. Mount /boot to /mnt/boot. This device should be a traditional partition.
    mount /dev/sda1 /mnt/boot
  3. Mount system pseudo file systems under /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
  4. "change root" or chroot to /mnt
    chroot /mnt
  5. Under /boot/grub, there is a file called "device.map." The file needs to be populated according to your disk layout. The first disk should be  (hd0 ) . If the file looks fine, then continue to the next step. If it is missing or looks incorrect, populate it according to the following template.
    (hd0) /dev/sda
    (hd1) /dev/sdb
    (hd2) /dev/cciss/c0d0
    (hd3) /dev/cciss/c0d1
  6. Launch the grub interactive shell
    grub
  7. In the interactive shell, you will see a "grub>" prompt. With grub the first partition on the first hard drive is hd0,0. The following example will install Grub on the first parition of the first drive.
    grub> root (hd0,0) 
    
    Filesystem type is ext2fs, partition type 0x83
    grub> setup (hd0) 
    Checking if "/boot/grub/stage1" exists... yes 
    Checking if "/boot/grub/stage2" exists... yes 
    Checking if "/boot/grub/e2fs_stage1_5" exists... yes 
    Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.succeeded 
    Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/boot/grub/stage2/boot/grub/menu.lst"... succeeded
    Done.
  8. Type quit
  9. Type exit
  10. Type reboot

The server should now reboot.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7001376
  • Creation Date: 17-Sep-2008
  • Modified Date:15-Mar-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.