grub problem

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

grub problem

Postby roywhite » Jan 13th, '12, 01:25

New to Mageia and would like to use it long enough to form an opinion. So far it seems pretty slick. Although I have just installed it already a problem: I have 3 OS' with 2 hd. win xp & Ubuntu 10.04 on a sata drive and Mageia on an ide drive. After installing Mageia I lost my Ubuntu in grub. I tried to add it with the Mageia control center boot setup, but I have not had any sucess as of yet. When I try to boot ubuntu from grub I get an error message "unable to mount selected partition". This is not a new problem I have been running 2 hard drives on my machine for approx 5 years. some distros just wont see my ide drive. any help would be appreciated.
RRW
roywhite
 
Posts: 2
Joined: Jan 13th, '12, 00:38

Re: grub problem

Postby barjac » Jan 20th, '12, 21:46

Would you please download this script :-
http://sourceforge.net/projects/bootinf ... t/download
Make it executable:-
chmod +x boot_info_script.sh
Run it as root:-
su
./boot_info_script.sh
...and pastebin the output file:- ~/RESULTS.txt
and post a link here.

EDITED script name - it's changed since I last used it ;)
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: grub problem

Postby roywhite » Jan 21st, '12, 21:38

gave up on Mageia for now. Thanks for the reply
roywhite
 
Posts: 2
Joined: Jan 13th, '12, 00:38

Re: grub problem

Postby barjac » Jan 22nd, '12, 00:13

FWIW Mageia uses legacy grub - Ubuntu uses grub2.
Ubuntu has a bug in it's OS-prober that stops it adding Mageia (or Mandriva) to it's menu correctly.
Mageia (and any distro with legacy grub AFAIK) cannot add systems using grub2 to the boot menu automatically.
Both of the above problems have relatively easy workarounds so don't hesitate to ask again if you decide to come back here - maybe when Mageia 2 is released ?
If your disk problem is down to some other issue - I hope you manage to resolve it ;)
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: grub problem

Postby wilcal » Jan 22nd, '12, 04:25

I gave up on the Linux/Grubx/WinBlows dual boot
process. So quite some time ago I started to equip
all my platforms with one of these:

http://www.newegg.com/Product/Product.a ... 6817121177

You can still buy HD's for testing for under $50. Much
less stress.
"DISK BOOT FAILURE - INSERT SYSTEM DISK AND PRESS ENTER"
is my friend
wilcal
 
Posts: 567
Joined: Jun 20th, '11, 02:01
Location: San Diego CA

Re: grub problem

Postby Ecky » Feb 2nd, '12, 22:03

barjac wrote:FWIW Mageia uses legacy grub - Ubuntu uses grub2.
Ubuntu has a bug in it's OS-prober that stops it adding Mageia (or Mandriva) to it's menu correctly.
Mageia (and any distro with legacy grub AFAIK) cannot add systems using grub2 to the boot menu automatically.

I, too, am new to Mageia and I, too, have this problem. I'm running WinXP on sda and Ubuntu/Mint/Mageia on sdb1/3/4. After installing Mageia, I lost both Ubuntu and Mint from my boot menu, and after re-install of grub2 from Ubuntu live disk, Mageia failed to boot although it appeared in the menu. From what barjac says above, I understand this is the way it goes.
barjac wrote:Both of the above problems have relatively easy workarounds

...mind giving me a hint? I'd like to make friends with Mageia but she doesn't seem to get along with my old pal Ubuntu, it's either one or the other! ;)
Ecky
 
Posts: 3
Joined: Feb 2nd, '12, 21:54
Location: Finland

Re: grub problem

Postby David_Batson » Feb 4th, '12, 02:50

Using grub2 from Arch Linux and booting Mageia 1 (grub1) fine from it.
https://bbs.archlinux.org/viewtopic.php ... 2#p1019742

If you use uuid in your boot line, make sure it is the correct one. You can check this with # blkid
You can also use /dev/sda* (actual path will vary depending upon your setup) or similar line as an alternative to uuid (see in my post above as it uses both).
David_Batson
 
Posts: 128
Joined: May 1st, '11, 05:19

Re: grub problem

Postby dyfi » Feb 4th, '12, 08:21

Hi,

For the inexperienced (which includes me) there are a couple of other easy methods which do not require grub editing.

1. Download and burn Super Grub 2 Disk which will find and boot grub1 and grub2 OS. Just leave it in your CD tray and boot from there.

2. I have always used a good quality external USB drive for backups. If you have or can acquire one, partition as a normal internal drive and install Mageia to it. Grub1 then is installed to this drive (sdb) and grub2 is still on (sda). This is the method I use and has the advantage of making Mageia portable as well. Just ensure that your BIOS supports booting from a USB device.

Dyfi.
dyfi
 
Posts: 35
Joined: Dec 2nd, '11, 16:25

Re: grub problem

Postby barjac » Feb 5th, '12, 14:48

Ecky wrote:...mind giving me a hint? I'd like to make friends with Mageia but she doesn't seem to get along with my old pal Ubuntu, it's either one or the other! ;)

OK, you need to decide which system's boot loader you are going to use as the "master" i.e. the one which resides in your MBR and points to the initial boot menu.
I'm guessing that you now have an Ubuntu based grub2 main menu, so going with that for now...
You will probably find that the entries in /boot/grub/grub.cfg have errors in the lines that point to initrd.img.
Use an editor as root to look at and edit the file:-
Code: Select all
sudo gedit /boot/grub/grub.cfg

Look for your main Mageia entry which will be something like:-
Code: Select all
menuentry "linux (on /dev/sdb7)" {
   insmod ext2
   set root='(hd1,7)'
   search --no-floppy --fs-uuid --set 9d93628f-b81a-4e6d-a436-173697556020
   linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=9d93628f-b81a-4e6d-a436-173697556020 resume=UUID=1097bb8c-3820-4b3a-b796-b417c9aa56d8 splash=silent vga=788
   initrd (hd1,6)/boot/initrd.img

Note that the last line includes (hd1,6), which is wrong and is produced by a bug in Ubuntu's OS-prober [1].
This should be the same as the "set root=" line and needs changing in the example above to "initrd (hd1,7)/boot/initrd.img".
Apply similar corrections to your grub.cfg, save the file and you should be able to boot Mageia.

[1]
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606904
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566102
EDIT These Debian bugs are still not fixed after 12 months and I now notice another duplicate:-
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614516

EDIT The bug in os-prober is finally fixed in os-prober-1.53 released yesterday (May 8th 2012). Installing this release of os-prober in a Debian/Ubuntu etc. system and running update-grub should now produce a bootable Mageia menu entry.
Last edited by barjac on May 9th, '12, 22:58, edited 3 times 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: grub problem

Postby wobo » Feb 5th, '12, 15:34

Well, I'm a bit puzzled by the reports about Ubuntu having problems to "see" an already present Mageia. My setup is only on one hd but that should not make a difference.

/dev/sda1 Windows7 rescue system
/dev/sda2 Windows7
/dev/sda5 swap
/dev/sda6 data
/dev/sda7 mageia with grub-legacy in MBR
/dev/sda8 mageia cauldron with grub-legacy in root partition, loaded from mageia's grub via chainloader
/dev/sda9 ubuntu with grub2 in the root partition of ubuntu, loaded from mageia's grub via chainloader.

Ubuntu installed after all others. Ubuntu's grub menue shows all present systems (windows, 2x mageia), even the rescue system of Windows. So I was surprised reading about that "bug" in Ubuntu's grub.
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby barjac » Feb 5th, '12, 16:05

wobo wrote:Ubuntu installed after all others. Ubuntu's grub menue shows all present systems (windows, 2x mageia), even the rescue system of Windows. So I was surprised reading about that "bug" in Ubuntu's grub.

Did you look at the grub.cfg in your Ubuntu install and check the Mageia entry?
Is it correct, or does OS-prober still get it wrong ?
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: grub problem

Postby dyfi » Feb 5th, '12, 16:56

Nice one!
I checked my grub.cfg in SalineOS (which is Debian based) and the error illustrated was present. Modified as per thread, and bingo, Mageia will now boot from grub2 menu.

Thanks very much.

Dyfi
dyfi
 
Posts: 35
Joined: Dec 2nd, '11, 16:25

Re: grub problem

Postby wobo » Feb 5th, '12, 18:44

barjac wrote:Did you look at the grub.cfg in your Ubuntu install and check the Mageia entry?
Is it correct, or does OS-prober still get it wrong ?

All entries are correct and the systems boot ok from Ubuntu - of course I checked that only once after the installation of Ubuntu. Normally it is of no interest for me because I boot all systems from the first bootloader menue (Mageia).
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby Ecky » Feb 6th, '12, 12:14

Thanks for your response everybody.

I edited my /boot/grub/grub.cfg within Ubuntu (despite a warning in the file that says it must not be edited) and the problem is now fixed for the time being. I guess it will come back each time update-grub is run from within Ubuntu so the fix must be re-applied every now and then. Not a big problem, now that I know how to do it.

I don't know if any developers read these threads but just in case I would like to say this:

Boot problems in dual boot systems are rather commonplace and although they usually are relative easy to fix, they are very scary from a novice user point of view. Think a Linux newbie who has just installed his first non-Microsoft system and upon first startup he only gets a non-working menu screen and his Windows and everything appears to be vanished; panic is near. Even if he stays calm, boots his system from a live CD and starts googling for solutions, he will be forced to go to command line and maybe tinker with configuration files which is not an easy task for a perfect stranger to Linux. Personally I don't understand why there is no decent GUI front end for grub2 (at least as far as I know). Therefor I was very pleased to see that Mageia has one for legacy grub; unfortunately, as we have seen, it doesn't help if the "concurrent" system uses grub2. Please keep up the good work, maybe introduce grub2 in next Mageia release, and provide us with a good, layman-friendly boot configuration tool!

Thank you for your time. ;)
Ecky
 
Posts: 3
Joined: Feb 2nd, '12, 21:54
Location: Finland

Re: grub problem

Postby wobo » Feb 6th, '12, 12:41

You avoid all these problems if you put each grub of the installed systems into the BR of their root partition (except the first one) and then load each system from the first vie chainloader.
I wonder why so many people jump through all those loops instead using chainloader.
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby Ecky » Feb 6th, '12, 13:46

wobo wrote:I wonder why so many people jump through all those loops instead using chainloader.

I don't (wonder). If you read carefully my previous message, you may get a hint. ;)
Ecky
 
Posts: 3
Joined: Feb 2nd, '12, 21:54
Location: Finland

Re: grub problem

Postby doktor5000 » Feb 6th, '12, 14:04

Well, maybe your assumptions are a bit off. The classical way for novices to install linux the first time is normally
as dual-boot next to an existing windows installation (let alone a minority which installs linux as only system,
which does not have these boot-problems as described here) which does not give any problems when
doing a default installation. You get your new linux bootloader, which has a chainloader entry for the windows bootloader.
I see no problem with that.

If you're doing more linux installations, you're no novice user, and you can ask before doing so for recommendations,
which avoids all the problems mentioned here. One primary bootloader in the MBR, all others in the according
partitions, and using chainloader entries.

BTW: The way you setup the boot entry for Mageia, you'll get problems with next ubuntu kernel update,
as your changes will be overwritten (hence the "automatically generated" notice at the top of /boot/grub/grub.cfg)
You should have added it like described in: https://help.ubuntu.com/community/Grub2 ... nu_Entries
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub problem

Postby wobo » Feb 6th, '12, 14:08

Ecky wrote:
wobo wrote:I wonder why so many people jump through all those loops instead using chainloader.

I don't (wonder). If you read carefully my previous message, you may get a hint. ;)

I only get the hint that nobody told you from the start to use chainloader nor was there any nice documentation how to do it. What I find so often in these forums are long and complicated listings how to configure this and that while it is so easy and uncomplicated.

Say, I start out with a distribution A using grub legacy. I let the install system put that into the MBR, so in the boot menue I have SYSTEM A, SYSTEM A failsafe and (if on the hd) Windows.
Now I install distribution B with grub2. I let the installer install the bootloader into the root partition of SYSTEM B.
Then I boot SYSTEM A and edit the /boot/grub/menu.lst and add 3 lines:
label SYSTEM B
root (0,x)
chainloader +

Advantages:
- it does not matter what version of grub is in distribution B or C or D or N.
- I will not have to edit anything whenever any of the distributions gets a kernel or version update/upgrade.
- I can add as many distributions I want without worrying about the version of grub, the only thing I have to do after a new distribution gets installed is adding the matching 3 lines into the menu.lst of distribution A.

When I received a new hd I started out doing it right: I installed an old grml version (just the basic system) on a 100MB partition for the "main" grub. Now I can add whatever I want only by adding 3 lines in that main grub.

Reading all this makes me wonder why I do not write such a nice HowTo as mentioned in my first paragraph. But of course nobody will read it before he comes to the forum with a borked system (such as yours).
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby dyfi » Feb 6th, '12, 17:01

Very nicely written - I have learnt quite a lot from this thread - thanks very much!
dyfi
 
Posts: 35
Joined: Dec 2nd, '11, 16:25

Re: grub problem

Postby doktor5000 » Feb 6th, '12, 21:29

wobo wrote:Reading all this makes me wonder why I do not write such a nice HowTo as mentioned in my first paragraph. But of course nobody will read it before he comes to the forum with a borked system (such as yours).


Uhmm, maybe just translate the relevant (grub) parts of http://www.mandrivauser.de/doku/doku.ph ... eipinguine ?
No need to reinvent the wheel ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub problem

Postby barjac » Feb 7th, '12, 14:29

wobo wrote:while it is so easy and uncomplicated.

Say, I start out with a distribution A using grub legacy. I let the install system put that into the MBR, so in the boot menue I have SYSTEM A, SYSTEM A failsafe and (if on the hd) Windows.
Now I install distribution B with grub2. I let the installer install the bootloader into the root partition of SYSTEM B.
Then I boot SYSTEM A and edit the /boot/grub/menu.lst and add 3 lines:
label SYSTEM B
root (0,x)
chainloader +

Advantages:
- it does not matter what version of grub is in distribution B

Err.. but in most cases it does.
To boot into grub2 from grub you will probably need an entry in menu.lst of the form:-
Code: Select all
title Ubuntu 9.10 (grub 2)
root (0,6)
kernel /boot/grub/core.img

...unless you are very lucky.
I have heard of rare cases where chainloading works - and you may be one of these, but in general the above method is more reliable.
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: grub problem

Postby wobo » Feb 7th, '12, 16:06

barjac wrote:To boot into grub2 from grub you will probably need an entry in menu.lst of the form:-
Code: Select all
title Ubuntu 9.10 (grub 2)
root (0,6)
kernel /boot/grub/core.img

...unless you are very lucky.
I have heard of rare cases where chainloading works - and you may be one of these, but in general the above method is more reliable.

Well, My experience with people using chainloader is quite the opposite, like "rare cases it did NOT work". :) Did you try it?
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby barjac » Feb 7th, '12, 23:46

http://forum.mandriva.com/en/viewtopic. ... c8#p761355
I didn't try recently, as I now use grub2 as my main bootloader, and I don't use Ubuntu.
Chainloading is deprecated in favour of multiboot in grub2, so I have no reason to expect that anything has changed.
Anyhow - if it works for you then fine, I just wanted to point out that it won't work for some. ;)
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: grub problem

Postby wobo » Feb 8th, '12, 02:48

Ok, thx for the link because that's the first time I read about problems with chainloader. Will watch out for this problem (so far I haven't experienced it here with neither Ubuntu nor openSUSE, Debian, PCLinuxOS (added today), nor some others which have visited my harddisk and have gone).
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: grub problem

Postby barjac » May 9th, '12, 14:33

I finally decided to dig into os-prober code myself - and found the problem. :D
I sent a patch upstream (Debian) which is now included in os-prober-1.53 (just released).

Updating to that version when it becomes available for your grub2 based distro will solve this issue, making Mageia, Mandriva and PCLOS installations bootable from grub2 automatically.
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

Next

Return to Basic support

Who is online

Users browsing this forum: dbg and 1 guest

cron