Page 1 of 1

[RESOLVED] Grub2 menu problem after urpmi upgrade, M3 to M4

PostPosted: Nov 21st, '14, 18:59
by rc10b
I have just carried out a urpmi upgrade from M3 to M4 and my grub2 menu system is misbehaving. I have a small Master grub2 partition at the beginning of my boot disk, sda, (set up as boot in the bios, booting from the MBR and the partition has a boot flag) and the menu system allows me to boot four different os's, three Mageia and one Windows.
Before the upgrade the system booted as intended using grub2 on sda but after the upgrade it boots into grub2 on / of sdc, which now contains my upgrade to M4. I have a menu item in this grub2 menu which allows me to return to the Master Grub2 Menu (on sda) and this still works. So, I can still successfully boot whichever os I choose.

I have used bootinfoscript to see if if that sheds any light on the problem and at the beginning of the output I see this:
============================= Boot Info Summary: ===============================

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img, but core.img can not be found at this
location.
=> Grub Legacy (v0.97) is installed in the MBR of /dev/sdb and looks on the
same drive in partition #2 for /boot/grub/stage2 and /boot/grub/menu.lst.

This indicates that core.img cannot be found, but it does exist in /boot/grub2/i382-pc/ on this Master partition.
Also I see that the Grub2 version is shown as v1.99 but I have manually installed grub2 on /dev/sda and in MCC the version is shown as 2.00-59.1.mga4.
Most grub2 issues that I've found by searching relate to failure to boot but I do not have this problem, I just don't know what to do to boot into the correct menu, so any help will be greatly appreciated.

Re: Grub2 menu problem after urpmi upgrade from M3 to M4 64b

PostPosted: Nov 22nd, '14, 00:51
by unklar
That's what happens when you never tell the original system, to have a separate / boot partition ...
You can try (no guarantee)
the magic word is chroot

Mageia live CD
terminal
root
Code: Select all
mount /dev/sda2 /mnt                       <  example for (!)  /
mount /dev/sda1 /mnt/boot                  <  example for (!)  /boot
mount --bind /dev/ /mnt/dev
mount --bind /proc/ /mnt/proc
mount --bind /sys/ /mnt/sys
mount --bind /dev/pts /mnt/dev/pts
mount --bind /run/ /mnt/run         
chroot /mnt /bin/bash

/usr/sbin/grub2-install --boot-directory=/mnt /dev/sda1
update-grub2

exit

Re: Grub2 menu problem after urpmi upgrade from M3 to M4 64b

PostPosted: Nov 23rd, '14, 23:45
by barjac
Hi again,
Boot into your Mageia 4 and in mcc -> diskdrake give your Master grub partition a label e.g. "maingrub"
unless it already has a label and check that it is still being shown as sda1. If it is not sda1 then change the /dev/sda in the command below.
Then:
Code: Select all
su
mkdir -p /maingrub
mount -L maingrub /maingrub && grub2-install --root-directory=/maingrub /dev/sda
umount /maingrub
exit


EDIT after PM from OP
Your /boot/grub2/drakboot.conf is pointing to /dev/sda when it should be pointing at the root of your Mageia 4 installation.
/EDIT

The above should fix it.

Re: Grub2 menu problem after urpmi upgrade from M3 to M4 64b

PostPosted: Nov 24th, '14, 00:56
by rc10b
@barjac
That's fixed it, thanks for responding.

Re: Grub2 menu problem after urpmi upgrade from M3 to M4 64b

PostPosted: Nov 24th, '14, 01:56
by barjac
rc10b wrote:@barjac
That's fixed it, thanks for responding.

Great!
Now change /boot/grub2/drakboot.conf in your Mageia 4 system to contain "boot=/dev/sdcX" (where X is the partition number of the Mga4 root partition)
On subsequent grub2 package updates only /boot/grub2/i386-pc/core.img will then be updated and nothing will be written to any MBR, keeping your own custom grub2 bootloader intact.
If a device (e.g. sda) is in drakboot.conf then the MBR of that device will be updated when the grub2 package is updated.

Just a note of explanation for other readers:
If grub2 had been initially installed (or later re-installed) in Mageia 3 using the bootloader tool in MCC (drakboot) and had been told to put the bootloader in the root partition, then the drakboot.conf would have been correct and the upgrade would have gone smoothly.

Re: [RESOLVED] Grub2 menu problem after urpmi upgrade, M3 to

PostPosted: Nov 24th, '14, 11:34
by rc10b
I'll make that change and test it out soon when M5 is released.
Thanks.

Re: [RESOLVED] Grub2 menu problem after urpmi upgrade, M3 to

PostPosted: Nov 24th, '14, 12:57
by unklar
Excellent! @barjac
I had assumed that
the TE MGA4 can no longer boot.

I must improve my solution
Code: Select all
/usr/sbin/grub2-install --boot-directory=/mnt/sda1 /dev/sda

exit

Many thanks!

Re: [RESOLVED] Grub2 menu problem after urpmi upgrade, M3 to

PostPosted: Nov 24th, '14, 14:14
by barjac
unklar wrote:Excellent! @barjac
I had assumed that
the TE MGA4 can no longer boot.

I must improve my solution
Code: Select all
/usr/sbin/grub2-install --boot-directory=/mnt/sda1 /dev/sda

exit

Many thanks!

Yes I realized that you had misunderstood the issue - no problem :)