SUSE Support

Here When You Need Us

How to reinstall the GRUB boot loader

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

Environment

SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Desktop 10

Situation

The GRUB boot loader menu is no longer displayed.

Resolution

Reinstall the GRUB boot loader by following these steps:

1. Place your SLES/SLED 10 CD 1 or DVD in the drive and boot up to the CD or DVD. On the resulting menu select "Rescue System". This will boot you up to a text based terminal with a "Login" prompt. Enter"root" for the user name. You will be brought to a command prompt.

2. Enter the command "fdisk -l". This will display the partitions on your drives that may look something similar to the following:
 
 
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 262 2104483+ 82 Linux swap / Solaris
/dev/sda2 * 263 3449 25599577+ 83 Linux
/dev/sda3 3450 19456 128576227+ f W95 Ext'd (LBA)
/dev/sda5 3450 6060 20972826 83 Linux
/dev/sda6 6061 19456 107603338+ 83 Linux
 
This is an example from a SATA drive. IDE drives will have a device name of /dev/hda.

You need to know which of the partitions displayed is your root partition for the Linux system. If you took the default during installation it is typically the Linux partition just after the Linux swap partition.

3. Enter the command "mount /dev/sda2 /mnt". Be sure to replace /dev/sda2 with the appropriate device for your root partition.

*** Note:  With this partition mounted you can verify that it is the "/" (or root) partition by viewing the contents of the /mnt/etc/fstab file.  Run this command to display the file:

cat /mnt/etc/fstab

You should see this same partition being mounted to "/" in a line similar to this:

/dev/sda2    /    reiserfs   acl,user_xattr    1 1

If the file is not found then this is most likely not the root partition.  You can unmount the partition and try one of the others if needed.  Use the following commands as an example.  Just replace the device names with those on your system:

umount /mnt
mount /dev/sda3 /mnt

Remember that you will not be able to do the umount command if you have used the cd command to change directories into the /mnt directory.  If you get an error run the command "cd /" and try again.

4. Enter the command "grub-install --root-directory=/mnt /dev/sda". Be sure to replace /dev/sda with the correct device for your hard drive where the root partition exists (usually /dev/hda for IDE drives). The "sda" without the number on the end represents the drive where the 2 in "sda2" represents the partition number on the drive.

5. Once this command completes successfully reboot your system by entering the command "reboot". Your system will reboot and hopefully you will see the GRUB menu again.

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:3918735
  • Creation Date: 20-Nov-2006
  • Modified Date:16-Mar-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

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

SUSE Support Forums

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

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.

Open an Incident

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