• Re-install Grub2 from DVD Rescue

    Boot the Rescue from the DVD. This should be the same Arch as the installation: ie; 32 bit or 64 bit..


    Once the DVD rescue gets to 'login', type: root
    from there I run fdisk -l to confirm my HD partitition order.
    We need to mount root (for me that's sda3)

    Now mount / (sda3) with:
    Code: [View]
    mount /dev/sda3 /mnt
    To mount the other devices
    Next do:
    Code: [View]
    mount --bind /dev /mnt/dev
    Then chroot:
    Code: [View]
    chroot /mnt
    Code: [View]
    mount /proc
    Code: [View]
    mount /sys
    Your prompt changes to: Rescue:/>
    Here type:
    Code: [View]
    grub2-mkconfig -o /boot/grub2/grub.cfg
    Code: [View]
    grub2-install /dev/sda
    You can see it all here: https://dl.dropbox.com/u/10573557/Gr...ect/rescue.jpg

    'exit'
    # reboot

    If you use LVM please check this post: https://forums.opensuse.org/vbcms-comments/478290-article-re-install-grub2-dvd-rescue-3.html#post2519005

    N.B: This method should also work from a live cd
    This should be the same Arch as the installation: ie; 32 bit or 64 bit..USE LIVE CD TO RESCUE
    Comments 83 Comments
    1. vta_128's Avatar
      vta_128 -
      I had the same problem on my "service" computer - dual boot with WindowsXP. There was only text GRUB and a black screen. I did as caf4926 wrote and it is OK now. Thank you very much.
    1. miniminor's Avatar
      miniminor -
      caf4926, thank you very much, you have saved my bacon! I did a fresh install of Windows XP (don't ask) and openSUSE 12.2 on an elderly 32bit pc. Apart from some initial problems re IDE/SATA/achi all went well. openSUSE then told me I had 30+ updates (which turned out to be 100+), and I had a little "endless loop" problem here, overcome by deselecting the final item with the ! by it. An hour or so later all were downloaded, and were mostly installed when a BSOD announced a kernel panic. Rebooted, and got no further than GRUB's "ELF smaller than expected". No linux, no XP, crise cardiaque.

      I had been copying onto the new installation (PATA) some files from an old SATA hard drive. Guess what? My new GRUB menu lists not only my new XP and 12.2, but also an old XP and an 11.1 on the SATA! So thank you again for some instructions which I did not understand but which have worked a miracle.
    1. caf4926's Avatar
      caf4926 -
      Good to know it's working for you folks
    1. folkpuddle's Avatar
      folkpuddle -
      I think I have found this article just in time. After an update I have been unable to gain access to my install. All my installs have grub installed to their root partitions. I have one controlling menu.lst on a linux partition with legacy grub installed to a usb stick which works extremely well.

      This my first venture into grub2 and I wasonly able to boot to my new install twice by chainloading before the update which did something I know nothing about.

      It may well be that the install is damaged beyond repair but I feel like experimenting.
      My root is dev/sda10

      So from the dvd would I propose to mount /dev/sda10

      Code:
      mount /dev/sda10 /mnt
      Code:
      mount --bind /dev /mnt/dev
      

      Code:
      chroot /mnt
      Code:
      grub2-install /dev/sda10


      You also mention that you did not do a grub2-mkconfig -o etc. etc. because you knew your grub.cfg was already correct

      Of course I can make no such assumptions as I know nothing about whether it is right or not- I saw one posted in the forums today and it looked might complicated to me.
      I will wait to hear from you in case you have another idea.
      Thanks,
      Hugh
    1. caf4926's Avatar
      caf4926 -
      You can run the mkconfig once you are chroot
      That will make a correct config file

      Grub should be installed to sda not sda10 or whatever number
      That's where sda is the boot hd, which it should typically be
    1. folkpuddle's Avatar
      folkpuddle -
      Quote Originally Posted by caf4926 View Post
      You can run the mkconfig once you are chroot
      That will make a correct config file

      Grub should be installed to sda not sda10 or whatever number
      That's where sda is the boot hd, which it should typically be
      Yes, but sda is not my boot hd. My boot drive is a usb flash drive. Legacy Grub from my first
      linux installation is installed there and the menu.lst of that install contains the
      entries for the other five.
      The currently non-booting OS is 12.2 openSUSE which refuses to boot since the first update.

      I think I'll give it a try anyway.

      Running mkconfig will be my first task. Complicated business this Grub2 stuff.

      Cheers,

      Hugh
    1. caf4926's Avatar
      caf4926 -
      Quote Originally Posted by folkpuddle View Post
      Yes, but sda is not my boot hd. My boot drive is a usb flash drive. Legacy Grub from my first
      linux installation is installed there and the menu.lst of that install contains the
      entries for the other five.
      The currently non-booting OS is 12.2 openSUSE which refuses to boot since the first update.

      I think I'll give it a try anyway.

      Running mkconfig will be my first task. Complicated business this Grub2 stuff.

      Cheers,

      Hugh
      Then it should be written to the MBR of that as well as the partition that contains /boot
      There will also be a /boot on the system target /dev/sda10, write to that as well for belt and braces
    1. crmrhm's Avatar
      crmrhm -
      This fix worked for me (dual-boot OpenSuSE 12.2 and Windows XP). I changed labels on some partitions, which I thought was rather harmless, but on reboot, all I had was text GRUB and a black screen. This procedure set everything right again. Thanks.
      Howard
    1. caf4926's Avatar
      caf4926 -
      Quote Originally Posted by crmrhm View Post
      This fix worked for me (dual-boot OpenSuSE 12.2 and Windows XP). I changed labels on some partitions, which I thought was rather harmless, but on reboot, all I had was text GRUB and a black screen. This procedure set everything right again. Thanks.
      Howard
      Good to know, thanks for the feedback
    1. DRELKE's Avatar
      DRELKE -
      Appreciate the information.

      I've been running openSUSE 12.2 for about a month, and it was working fine. However, with a recent update of patches all of a sudden when booting into Linux it would simply stop at "GRUB _" (blinking cursor). Never went beyond that point for any openSUSE splash screen, etc. I do remember that one of the patches said something about GRUB, and apparently that's the culprit that has caused my recent issue. Thanks.
      David
    1. caf4926's Avatar
      caf4926 -
      Quote Originally Posted by DRELKE View Post
      Appreciate the information.

      I've been running openSUSE 12.2 for about a month, and it was working fine. However, with a recent update of patches all of a sudden when booting into Linux it would simply stop at "GRUB _" (blinking cursor). Never went beyond that point for any openSUSE splash screen, etc. I do remember that one of the patches said something about GRUB, and apparently that's the culprit that has caused my recent issue. Thanks.
      David
      Hope that fixed it for you David
    1. folkpuddle's Avatar
      folkpuddle -
      Hello again,

      Sorry I was ill since I last posted - but I do have an update.

      I also had the upper case words GRUB when I first reported the incident.
      From a grub2 troubleshooting article:
      GRUB - a single word at the top left of the screen, with no prompt and no cursor.
      GRUB has failed to find even the most basic information, usually contained in the MBR or boot sector.
      After running the grub rescue re-install from DVD I ended up with a grub prompt.
      This in itself is an improvement but I was still unable to effect a successful boot.

      I have a long week in bed to think about this and I feel that it is not worth proceeding.
      I already have another successful openSUSE 12.2 install with legacy grub in the root partition and the
      relevant paragraph cut and pasted to the menu.lst of the multiboot controlling linux install which has its legacy grub installed
      to the mbr of a usb stick.

      Hi best wishes to all those who wrote in with success stories.
      Well done,

      Hugh
    1. caf4926's Avatar
      caf4926 -
      Hugh,

      You need to tell us more about the system setup. Partitions / HD's etc
    1. folkpuddle's Avatar
      folkpuddle -
      Quote Originally Posted by caf4926 View Post
      Hugh,

      You need to tell us more about the system setup. Partitions / HD's etc
      Helo again,

      I persevered after all.

      Here is what I did. My last report said I had a grub prompt which was an improvement.
      The grub prompt turned out to be legacy grub. With my knowledge of Legacy Grub I was able to
      check out the geometry of the hard drives ( I have two installed) to make sure grub knew where it was installed.
      Aha. Grub thought it was installed on (hd1,9) and not on (hd0,9) or sdb10 instead of sda10.

      Armed with this insight I was able to issue the following commands at the legacy grub prompt:

      grub>root (hd1,9)
      grub>kernel /boot/vmlinuzn(umbersofkernelhere).desktop root=/dev/sdb10 ro
      grub>initrd /boot/initrd(numbersofimagehere)
      grub>boot

      And it did. It booted into the lost openSUSE.

      Next step was to reinstall Grub2.
      For that I opened a terminal as root and issued the following command

      grub2-install --force /dev/sda10

      still at the root prompt I issued the grub2-mkconfig -o /boot/grub2/grub.cfg string as shown in your article.

      Al is well now. I was able to continue to boot to the 'lost' install and last night I finished off by
      installing nvidia the hard way with jcdaniel's excellent script.

      Best wishes,

      Hugh
    1. Relative's Avatar
      Relative -
      Quote Originally Posted by DRELKE View Post
      Appreciate the information.

      I've been running openSUSE 12.2 for about a month, and it was working fine. However, with a recent update of patches all of a sudden when booting into Linux it would simply stop at "GRUB _" (blinking cursor). Never went beyond that point for any openSUSE splash screen, etc. I do remember that one of the patches said something about GRUB, and apparently that's the culprit that has caused my recent issue. Thanks.
      David
      I also was running fine, but just for the day I installed from scratch. It was after the patches (GRUB was in there somewhere) that I wound up at the same point. Just a stop at "GRUB _" (blinking cursor). This procedure fixed me right up - so far.

      Many thanks from me too.

      Mike Cebula
    1. caf4926's Avatar
      caf4926 -
      Quote Originally Posted by Relative View Post
      I also was running fine, but just for the day I installed from scratch. It was after the patches (GRUB was in there somewhere) that I wound up at the same point. Just a stop at "GRUB _" (blinking cursor). This procedure fixed me right up - so far.

      Many thanks from me too.

      Mike Cebula
      I'm just pleased folks can actually understand the things I put together.
    1. mrmazda's Avatar
      mrmazda -
      Quote Originally Posted by caf4926 View Post
      Grub should be installed to sda not sda10 or whatever number
      That's where sda is the boot hd, which it should typically be
      To minimize likelihood to need repairing multiboot with Windows, the MBR is where Grub/Grub2 should not be, regardless where the Grub2 devs insist it belongs. see: Bugs/grub - openSUSE
    1. londy's Avatar
      londy -
      Thanks for posting this. I was messing around with the boot partition and ended up with an unbootable system. Your instructions saved me.

      I want to add a tip for people using encrypted lvm. Instead of starting the rescue system, just start the installation. On the second step, it'll ask for your passphrase and setup your lvm. After that hit alt+ctrl+f2 and do the rest of the rescue from there.
    1. MirceaKitsune's Avatar
      MirceaKitsune -
      Thank you for this very useful article! I've never had issues with grub/grub2 on my main machine (thank goodness) but I did some experiments on an openSUSE VM and broke grub2. The machine was dispensable, but I wanted to learn how to repair it in case grub ever breaks on my primary machine. I followed those steps and grub was indeed re-installed properly and would work again (openSUSE 12.2).
    1. HRGargi's Avatar
      HRGargi -
      Same for me! I just tried it on a VM in case of a real breakdown of my bootloader. These steps are working without any problems. Thanks for that article!