HowTo Boot into openSUSE when it won't Boot from the Grub Code on the Hard Drive

Scenario: Suddenly openSUSE won't boot. Maybe right after you installed it, or after an update, or just for no reason, it won't boot. OK, before you can repair the bootloader you usually have to boot into openSUSE. Here are the various ways to get around that catch 22 situation:

Note: this is a reference page.Try to figure out which option fits your problem, but if you can't, then use the fourth method (if you have the installation DVD). This is also described with incorporation of Windows booting in a companion tutorial.

But what do I do once I've booted into openSUSE? Install a comprehensive new bootloader: See the Appendix.

↑↑↑↑Boot the installed system from the Installation DVD [except for 11.0]

The Installation DVDs carry a facility that locates and boots an existing installation of SuSE/openSUSE. Try to use an installation DVD that matches the Version that's installed. The steps are slightly different for versions 10.x and 11.x, so I cover both. The developers left this facility out of Version 11.0, what a pity.

Boot from the openSUSE 11.x Installation DVD [x ≥ 1]

Boot from your installation DVD. On the first menu screen, select Installation. Proceed past the Licence screen to the Installation Mode screen. The Installation Mode screen has these options:

  • New Installation
  • Update
  • Repair Installed System

Select Repair Installed System and Next to the Repair Method screen. Select Expert Tools. You will be presented with the Repair Tool Box screen. Select to Boot Installed System. If there are multiple installations on the drive you might be presented with a list of partitions (so select one), otherwise the system should auto-boot.

Boot from the SuSE/openSUSE 10.x Installation DVD

Boot from your installation DVD. On the first menu screen, select Installation. Proceed past the Language screen and the Licence screen to the Installation Mode screen. The Installation Mode screen has these options:

  • New Installation
  • Update
  • Other Options

Select Other Options and a sub-menu will open which includes the choice: Boot Installed System. Highlight to boot the installed system and click Next. You should be presented with a list of partitions. Select a partition and click Boot.

↑↑↑↑Broken Grub menu: boot to the menu, drop to a console and boot openSUSE direct

Sometimes the only thing that works when you boot is that the Grub menu appears on screen. However when you select openSUSE from the menu, you only get an error message. You can often still boot to the installed SuSE operating system by operating at command level in the Grub shell as follows.

When you see Grub's boot menu on screen, instead of selecting a boot item, press the Escape key. That brings up a message like this:

  You are leaving the graphical boot menu
  and starting the text mode interface.

            OK       Cancel      

Select the OK option. That should bring a text-based menu on screen with the following text at the bottom: Use the arrow keys to select an OS, 'e' to edit or 'c' for command line. Press the 'c' key and you will get a grub prompt, like so: grub>
Now carry out the following dialogue at the grub> prompt:

You enter this ---------------- find /boot/grub/menu.lst
Computer returns like this ---- (hd0,4)
You enter this ---------------- root (hd0,4)
Computer returns like this ---- Filesystem type is ext2fs, partition type 0x83
You enter this ---------------- kernel /boot/vmlinuz
Computer returns like this ---- [Linux-bzImage, setup=0x000, size=0x25e910]
You enter this ---------------- initrd /boot/initrd
Computer returns like this ---- [Linux-initrd @ 0x37a9c000, 0x5534f3 bytes]
You enter this ---------------- boot

and Voila! The computer boots (we hope).

↑↑↑↑Reinstall Grub in the Master Boot Record and link it to the existing Grub menu in openSUSE

If you simply get a blank or uncommunicative screen or an error message when you boot and not even Grub's menu screen, your link to the boot menu in your existing openSUSE installation is broken. Provided that the installation in /boot/grub on the hard drive is intact, you can restore the code in the MBR and the link to the menu file (menu.lst) in your SuSE installation.

The method commences by booting your computer to Linux using any of a multitude of Live CDs like Knoppix, openSUSE Live CDs, SystemRescueCD, SuperGrubDisk, and many more. You can even boot the openSUSE install DVD and select the "Rescue System" option and start from there.

If you have a Linux Live CD, boot from it and log in. Then open a console window and enter su and you will be at the command prompt with rootly powers and ready to proceed.

If on the other hand you have the openSUSE install DVD, boot from it and on the first menu of options select the Rescue System option. That will start an elementary Linux Live operating system and bring you to the login prompt. Enter the username root and you will be at the command prompt with rootly powers and ready to proceed.

Whichever way you started (the openSUSE install DVD or a Linux Live CD) when you are at the root command prompt, first you find the partition containing openSUSE's bootloader. Then you reinstall Grub with a pointer to that partition.

First find the openSUSE installation:

You enter this ---------------- grub
Computer returns like this ---- grub>
You enter this ---------------- find /boot/grub/menu.lst
Computer returns like this ---- (hd1,6)

Here, (hd1,6) is Grub's pointer to my openSUSE installation on drive number 2, partition number 7. Your pointer will be different from my example (hd1,6). Substitute your correct values for my example (hd1,6). Now that you have your pointer, proceed like this:

You enter this ---------------- root (hd1,6)
Computer returns like this ---- Filesystem type is ext2fs, partition type 0x83
You enter this ---------------- setup (hd0)
You see 4-5 lines like this --- Checking if /boot/grub/stage1 exists ... yes
Computer finally returns this-- Succeeded.......Done
You enter this ---------------- quit
You enter this ---------------- reboot

The computer should reboot and present you with the Grub boot menu, from which you can boot into openSUSE.

↑↑↑↑Reinstall Grub in the Master Boot Record and write a new Grub menu into openSUSE

If all other methods fail, you can start again and install new Grub code in the Master Boot Record and also overwrite any corrupt menu files (menu.lst) in the existing openSUSE installation with a new menu file.

Boot from your installation DVD. On the first menu screen, select Repair Installed System. After the Kernel & the repair program load, you come to the Repair Method screen with three options:

  • Automatic Repair
  • Customised Repair
  • Expert Tools

Choose Expert Tools and the repair Tool Box window will open. From there select to Install New Boot Loader. Select the partition where you installed SuSE (if asked). You'll get the Grub GUI setup screen. Check under the Tab "Boot Loader Installation" that the checkmark is in "Boot from Master Boot Record" and remove any other checkmarks. Click "Finish". Wait for message "The boot loader was installed successfully". Click OK --> Next --> Finish. Ignore any error messages and reboot. That should install an elementary Grub and allow you to boot to openSUSE.

↑↑↑↑Boot from the SuperGrub Disk: see www.SuperGrubDisk.org

The SuperGrubDisk is a bootable floppy or CD. You boot to a menu of options. You can experiment with the options but I caution you about manipulating the Master Boot Record if you don't know what you're doing; i.e. be careful of the items marked "MBR". You are safe if you select any of the following options:

• Quick Menu Help
• !Linux! (1) Auto
• !linux! (>=2) Manual
• !Win!
• Easy Live Swap
• Press the 'c' key

(you should read this)
(to find and start the first Linux installation)
(to list Linux distros for you to choose)
(to find and start the Windows bootloader)
(to shift focus to the second hard drive)
(to put you at the grub> command line)

This is so easy to use. Download the CD ISO from the SuperGrubDisk site, burn the CD, boot it and choose either this option: "!Linux! (1) Auto" or this option: "!linux! (>=2) Manual" to boot into openSUSE.

↑↑↑↑APPENDIX: Installing a brand new bootloader once you've booted into openSUSE

Well the major hurdle has been cleared. Now you (probably) just need a brand new bootloader to overwrite everything and hopefully that will fix the underlying problem.

Go to Yast --> System --> Boot Loader. The Grub configuration screen comes up with the Tab "Section Management" activated. In the lower right is a drop-down selector labelled "Other". Select from "Other" the option "Propose New Configuration" and then wait for Grub to analyse your partitions and display a new configuration. This may take a while. Important: When that finishes, activate the tab labelled "Boot Loader Installation" and select to "Boot from the Master Boot Record". [Yast will often default to booting from the root or boot partition rather than from the MBR but that's for experts only -- always choose the MBR.] Then click Finish to save the changes and install the reconfigured Grub into the hard drive's MBR. If you get a message that "The bootloader boot sector will be written to a floppy disk ......... don't bother with the floppy -- just click OK to proceed and install to the MBR. Reboot and you should be able to boot to openSUSE using a new and reliable Grub with a new and reliable menu.

A final word for multiboot users with Windows tacked in there somewhere. You might want to read the attached tutorial if you need to tweak Grub to re-enable booting to windows: HowTo Multiboot openSUSE and Windows (2000, XP, Vista - any mix) using the GRUB bootloader

27 march 2009