Page 1 of 1

[SOLVED] rescue mode fails to re-install boot loader

PostPosted: Mar 1st, '12, 15:00
by wobo
After booting the Windows Rescue System (on /dev/sda1) - without actually doing something, only looking at the menue and then selecting "Reboot" - my system boots into
Code: Select all
GRUB Loading stage 1.5.
and sits there with a blinking cursur in the second line. My best guess is that even booting into that Windows Rescue System broke the MBR.

Now I booted with Mageia 1 DVD and selected "Rescue System".
It booted the Mageia rescue system and I selected "Re-install Boot Loader" from the menue. Result:
Code: Select all
=> found a %s root partition on /dev/sda7 (which is my main Mageia system)
=> type ext4, version 'Mageia release 1 (Official) for x86_64'
Mounting other partitions from fstab on /mnt...
Your system is ready on /mnt.

About to re.install Boot Loader grub of following %s distribution:
    Mageia release 1 (Official) for x86_64
=> ok? <oress Enter to continue, 'n' and Enter to cancel>
[Enter]
Installing boot loader...
running: sh /boot/grub/install.sh with root /mnt
grub failed: exec of sh failed: Exec format error
<press Enter to return to Rescue menu>
[Enter]
Program exited abnormally (return code 128) [OK]
Hitting OK takes me back to the rescue system menue.

So, now I sit there and in the back of my mind I hear old Harry singing "This is clear as mud that covers the ground and the confusion makes me head go round..."

Re: rescue mode fails to re-install boot loader

PostPosted: Mar 1st, '12, 23:09
by martinw
I remember getting into the same state once. As I recall, I "fixed" it by starting the installer and selecting "Upgrade existing installation". This was very quick because all the packages were already installed.

Someone more familiar with rescue mode might be able to give you better advice...

Re: rescue mode fails to re-install boot loader

PostPosted: Mar 2nd, '12, 11:45
by wobo
A member of the German forum reminded me that I have a brain myself.

Solution: Boot with a live cd, go to console, become root, mount the partition with the relevant grub entry. Then start grub and set it right:
Code: Select all
[root@localhost / ]# mount /dev/sda7 /mnt
[root@localhost / ]# cd /mnt
[root@localhost /mnt ] # grub
grub> root (hd0,0)    (where the relevant grub is, in my case it was [hd0,6] aka sda7)
grub> setup (hd0)     (Install GRUB in MBR)
grub> quit            (leave GRUB shell)
[root@localhost /mnt ] #


(credits go to wanne)