GRUB2 Recovery

Posted: March 9, 2013 in This and That
Tags: ,
Encountered an unpleasant issue today. Suddenly without any reason GRUB2 at my dual boot laptop halted with the “GRUB” string on the black screen and refused to proceed any further. Seems that is a known issue for the openSUSE 12.2 (GRUB2 became a bootloader for this version).
GRUB recovery usually an easy procedure and I did it quite often having several machines with a windows as a spare OS (it has an annoying habit deleting GRUB during own installation). I just used openSUSE live USB to load, and in Yast in Bootloader settings asked to propose the configuration for GRUB and then just saved it to the /boot partition.
This time it didn’t work at all… So I’ve spent all the day looking for solution. This two sources helped me a lot: Re-install Grub2 from DVD Rescue and openSUSE Help and Troubleshooting. Here you are the steps that helped me with my dualboot needs:
  1. Boot to Rescue System from the openSUSE installation DVD (login is root).
  2. Run fdisk -l to locate root partition (/dev/sda6 for me)
  3. Mount all that is needed (including partitions with other OSs so they will be scanned and included in GRUB configuration):
    • mount /dev/sda6 /mnt 
    • mount --bind /dev /mnt/dev 
    • chroot /mnt 
    • mount /proc 
    • mount /sys 
    • mount -a
  4. If the configuration file for GRUB is lost (like in my case):
    • grub2-mkconfig -o /boot/grub2/grub.cfg
  5. Write GRUB2 configuration to disc:
    • grub2-install /dev/sda
  6. Unmount and reboot:
    • umount -a
    • exit
    • reboot
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s