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

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

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

Postby rc10b » Nov 21st, '14, 18:59

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.
Last edited by rc10b on Nov 24th, '14, 00:57, edited 1 time in total.
rc10b
 
Posts: 70
Joined: Mar 30th, '11, 12:07
Location: UK - Hampshire

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

Postby unklar » Nov 22nd, '14, 00:51

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
unklar
 
Posts: 40
Joined: Apr 10th, '12, 20:30

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

Postby barjac » Nov 23rd, '14, 23:45

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.
Last edited by barjac on Nov 24th, '14, 02:05, edited 1 time in total.
Add this icon to your KDE desktop - save as "About.desktop" http://pastebin.com/raw.php?i=X10X1Ype
User avatar
barjac
 
Posts: 193
Joined: Apr 4th, '11, 10:26
Location: Rossendale UK

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

Postby rc10b » Nov 24th, '14, 00:56

@barjac
That's fixed it, thanks for responding.
rc10b
 
Posts: 70
Joined: Mar 30th, '11, 12:07
Location: UK - Hampshire

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

Postby barjac » Nov 24th, '14, 01:56

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.
Add this icon to your KDE desktop - save as "About.desktop" http://pastebin.com/raw.php?i=X10X1Ype
User avatar
barjac
 
Posts: 193
Joined: Apr 4th, '11, 10:26
Location: Rossendale UK

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

Postby rc10b » Nov 24th, '14, 11:34

I'll make that change and test it out soon when M5 is released.
Thanks.
rc10b
 
Posts: 70
Joined: Mar 30th, '11, 12:07
Location: UK - Hampshire

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

Postby unklar » Nov 24th, '14, 12:57

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!
unklar
 
Posts: 40
Joined: Apr 10th, '12, 20:30

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

Postby barjac » Nov 24th, '14, 14:14

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 :)
Add this icon to your KDE desktop - save as "About.desktop" http://pastebin.com/raw.php?i=X10X1Ype
User avatar
barjac
 
Posts: 193
Joined: Apr 4th, '11, 10:26
Location: Rossendale UK


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest