PDA

View Full Version : [ubuntu] Getting Grub2 in Karmic to Recognize Other Distros



motsteve
November 9th, 2009, 02:40 PM
I upgraded both my 32 and 64 bit distro's of Karmic and they run fine on my i7 machine. There were problems, of course, but all were fixed with some dithering. My problem involves trying to get grub2 to recognize other distros. I tried to follow all the hoop jumps of how to make grub2 work by not editing the grub.cfg file, etc, but the menu generated with update-grub2 will boot everything (including Windoz) except Mandriva 2010. My first attempt at booting, gave me an error message telling me that vga=788 is deprecated and to use set vx.... Not knowing how to "easily write a user script" for grub2 update, I edited the grub.cfg file. :-0! That got rid of the the vga=788 message but left:

[Linux-bzImage,setup=0x3a00,size=0x238ff0]
Error: file not found

This obviously is a message saying that it has the wrong kernel specified. I've tried all kinds of edits to the Mandriva segment of the grub.cfg file, but keep getting the pound sand error. I even reverted to the grub install that Mandriva did and Mandriva booted fine, but the other distros, although booting nicely, were in a menu resembling something on an LSD trip.

I'm used to going to the /boot of the partition I'm trying to boot, finding out what the images are and put in the images into menu.lst and the thing boots. What's the secret with grub2? Please don't flame me and call me a reactionary, etc, etc, but grub2 looks like a solution to a non-problem. I'll definitely switch to grub2, but I need help here.

dstew
November 9th, 2009, 06:59 PM
It sounds like the grub2 update process is not recognizing your Mandriva installation, or not creating a proper linux line in grub.cfg. As you know, the grub.cfg file is created new every time update-grub is run, so changes don't stay there.

So, if you run update-grub, you get a menu with a Mandriva item, but it doesn't boot properly? Is that your problem? Compare the kernel line in the old grub legacy menu.lst file, and the linux line generated by update-grub in the grub.cfg file. Are they the same? Are there some additional items (kernel parameters) in the menu.lst item that are not there in the grub.cfg item?

If so, you might need to edit the files that create the grub.cfg file, to make sure that the Mandriva linux line is created properly. You can edit the /etc/default/grub file, which has lines in it that will cause certain kernel parameters to be added to all linux lines (like quiet splash)

If you want to create a custom line for only one linux kernel, you will probably need to make a custom script to create that line. The scripts are in the /etc/grub.d/ directory. There is a script there, named 40_custom that is an empty template you can use to create a custom boot menu entry. You modify that file the way you need to, and save it as maybe 50_Mandriva. You need to give your new script executable privleges with
sudo chmod +x /etc/grub.d/50_MandrivaThen it will run when sudo update-grub is issued, and create the proper grub.cfg menu item.

The exact stuff you put in the custom script is documented in the Ubuntu Grub 2 documentation (http://ubuntuforums.org/showthread.php?t=1320435), see the item about half way down entitled "Creating the Custom Menu". Apparently all you need to do is copy the working item from the grub legacy menu.lst file and change a few words to the grub2 equivalents.

motsteve
November 9th, 2009, 08:05 PM
I used what update-grub2 gave me and altered it. I knew that vmlinuz was a symbolic link to the kernel, I used the kernel's full name instead along with the initrd's full name. No go. It seems a shame to me that a great upgrade like Karmic could be limited by a boot loader that uses the boot to kick the user's butt instead of just booting the distro.


Pardon my comment, but this sounds like the familiar sound of "bleeding edge" used by the Fedora crowd. I want the boot loader to do a boot load. Pretty and fancy I don't need. It only lasts 10 seconds, after all.

wolfdale
November 23rd, 2009, 06:27 AM
I ran into this problem when I installed Mandriva/openSUSE after Karmic. I solved it my re-installing GRUB2 (to Karmic root partition) whenever I install a new distro that I want to try out. The instructions are given here.

https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202

I use method 1 (simplest). The last command "sudo update-grub" picks other distros and adds it to GRUB 2 menu list.

oldfred
November 24th, 2009, 07:05 PM
I have always liked chainbooting. When I installed Karmic alpha I put grub2 into the partition and chainbooted to it from old grub. It complained about blocklist being "BAD" but worked.

If mandriva uses old grub just install old grub to the mandriva partition. Then all you need is a simple chainboot entry like the typical windows entry in your 40_custom or whatever file you want to use. Herman also talks about a new config file for grub2 customization but I do not understand that yet.

http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html#chain loader_boot_entry