I have a multi-boot system. I have winxp, mepis8, slackware13, and ubuntu 9.10 alpha5.
I am having trouble with grub and grub2 not playing nice. I am unable to start ubuntu.
I have grub 0.97 installed from my mepis install in the MBR. I then chainload +1 win, slack, and ubuntu. I have slack 13 installed with lilo installed to the root partition. I have ubuntu 9.10 installed with grub2 installed to the root partition.
Here is my menu.lst file.
timeout 60
color cyan/blue white/blue
foreground ffffff
background 0639a1
gfxmenu /boot/grub/message
title MEPIS at sda5, newest kernel
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 nomce quiet splash vga=791 resume=/dev/sda6
initrd /boot/initrd.img
boot
title MEPIS at sda5, previous kernel (if any)
root (hd0,4)
kernel /boot/vmlinuz.old root=/dev/sda5 nomce quiet splash vga=791 resume=/dev/sda6
boot
title MEPIS at sda5, kernel 2.6.27-1-mepis-smp
root (hd0,4)
kernel /boot/vmlinuz-2.6.27-1-mepis-smp root=/dev/sda5 nomce quiet splash vga=791 resume=/dev/sda6
initrd /boot/initrd.img-2.6.27-1-mepis-smp
boot
title Microsoft Windows XP Professional at sda1
rootnoverify (hd0,0)
chainloader +1
title Slackware
root (hd0,6)
chainloader +1
title Ubuntu 9.10
set root=(sd0,8)
chainloader +1
title MEMTEST
kernel /boot/memtest86+.bin
Origanlly I had just :
Ubuntu 9.10
root (sd0,8)
chainloader +1
I had errors:
File system type is ext2fs type 0x83
error 13 invalid or unsupported executable format
I changed it to
Ubuntu 9.10
set root=(sd0,8)
chainloader +1
Now I do not grt any errors but instead I get two lines that say:
chainload +1
grub
I have been searching and asked in the ubuntu forums with no luck. Will grub and grub2 not work together?
Thanke for any help, Kevin.
saikee
09-05-2009, 07:33 PM
I know in some recent versions Ubuntu has started to ship Grub2 as the default boot loader but I haven't got time to check it out.
This thread forced me to to try out Grub2 which in my opinion nowhere ready yet.
As I expected Grub2 will boot fine if we treat it as "any" other operating system without the knowledge of it. This is done when installing the new Ubuntu at the 8 of 8 step, click the "Advance" box and alter the boot loader location to be its root partition. Thereafter just boot it by the standard "chainloader +1" command in Legacy Grub. Say if the root partition is 9th partition of the 1st disk and known to Grub as (hd0,8). Legacy Grub (Version 0.9x) will fire it up with these command
title My Grub2 Ubuntu in (hd0,0)
root (hd0,8)
chainloader +1
In actual fact I installed Ubuntu 9.10 over a sda15 partition which had Puppy Linux 3.0 inside. I didn't even bother to amend the controlling Grub menu from sda6 and the new Ubuntu can be booted with the existing commands I used for Puppy Linux. If I change the Legacy Grub menu.lst the alteration is only in the "Title" statement which has no consequence to the booting process.
Do not mix the Grub2 commands with Legacy commands because you are using Lagacy Grub in the MBR and it will be that version that will be put into the memory to control the booting.
Have installed Ubuntu 9.10 Alpha5 in a SSD as well as a mechanical hard disk. The boot up time for the two are 30 and 40 seconds respectively.
Who says Linux is slow and SSD doesn't work faster than normal hard disk?
panther3e
09-05-2009, 08:25 PM
When I change menu.lst file to the basic chainloader +1 I get this error.
File system type is ext2fs type 0x83
error 13 invalid or unsupported executable format
The only thing I can do it to reset.
saikee
09-06-2009, 05:13 AM
That to me is Grub could not find a boot loader inside the partition you want to boot. In chainloading Legacy Grub simply passes the control to Grub2 but in your case Grub2 isn't there to be found.
My explanation is when you installed Ubunru you did not managed to tell the installer to put Grub2 in the root partition of the Linux. It is in the last step, 8th of the 8 steps, that you must specify this option. The default is for Grub2 in the MBR. I have it done both ways myself; one in SSD and one in a normal hard disk.
Couldn't advise how to fix it as I am just starting to read the Grub2 manual myself. The quickest is to re-install Ubuntu 9.10 again and watch the 8th Step of the installation like a hawk.
panther3e
09-06-2009, 08:53 AM
Thank you Saikee. I will give it another try.
panther3e
09-06-2009, 09:55 AM
I just reinstalled , made sure I picked to install grub to partition 9. I watched the output of the installer and seen it install grub to partition 9. Rebooted and received the same error. So I have a bad disk or hard drive issue.
Thanks Kevin
panther3e
09-06-2009, 12:33 PM
I installed Crunchbang linux. It is a ubuntu based distro. I installed it the same way as ubuntu 9.10. Installed grub in root partition. It started and worked like it should.
I beleive my ubuntu disk was a bad burn or corrupt.
ITT
09-06-2009, 10:40 PM
panther3e, on Crunchbang linux web page, there is the information that the last edition of Crunchbang linux it is -CrunchBang Linux 9.04.01- which is based on Ubuntu Jaunty Jackalope.
Ubuntu 9.04.01-jaunty jackalope -have Grub Legacy-GRUB 0.97.
panther3e
09-07-2009, 12:17 AM
Yes I know, I origanly was trying to install ubuntu 9.10 karmic. I had downloaded it twice, burned it twice, and installed it twice. All with no luck. I had the crunchbang disk handy to see if there was something wrong with my hard drive or the disk.
saikee
09-07-2009, 03:40 AM
panther3e,
It is funny that I don't get the sort of problems you are experiencing.
The curiosity got hold of me so I took out an old floppy that has Grub1 made from an old version of Mepis, booted it up, and used it to fire up Ubuntu 9.10 Alpha 5. Since my Ubuntu is in sda15 and these were the Grub1 commands I issued
root (hd0,14)
chainloader +1
boot
As a second trial I also took out an Open Solaris CD and booted it up. As Solaris now uses Grub1 so I can press "c" to get a Grub prompt before booting the Solaris up. In other word I used the Grub 0.97 version from Open Solaris and the above commands and was able to fire up the installed Ubuntu 9.10 again.
It is interesting to me because Ubuntu 9.10 has a Ext4 filing system as well as Grub2. Grub1 cannot read Ext4 because it is invented after Grub1 ceased to be maintained after Version 0.97. Therefore I tried and cannot fire up Ubuntu 9.10 directly (using "kernel" & "initrd" commands). However as far as I known there is no "installed" PC system that Grub1 cannot boot "indirectly" using the chainloading.
In chainloading Grub1 simply goes to the specified partition location specified by the "root" statement, loads the boot loader residing in that boot sector of the specified partition, hands over the control and buggers off itself. For this to happen you must tell Ubuntu 9.10 installer to place Grub2 in its root partition. That is all to it.
May be you can try it too, with a Grub1 floppy or CD.
saikee
09-08-2009, 03:36 AM
panther3e,
This is a thread I wrote on Grub2 (http://www.justlinux.com/forum/showthread.php?t=152790). You should find some of your questions are being answer there.
If you make a Grub2 floppy or CD then you can use it to boot up your Ubuntu 9.10. I tried and it works fine. You can also mix the Grub1 and Grub2 in the manner I described in the thread.
panther3e
09-08-2009, 06:05 PM
Thank you very much saikee. That is some nice information. That will come in very handy. I got very frustrated yesterday, after installing ubuntu 9.10 two times. I did not have any luck getting ubuntu to boot from grub1. I tried all of your suggestions with the grub boot disk and could not get it to boot.
So that was three times trying to get ubuntu to boot with grub1. Thats three strikes your out. I bit the bullet and installed again. This time installing grub2 to the MBR. It installed just fine, booted up, and looks very nice.
I had tried this a couple of months ago but I could never get my other installed linux distro's to start with grub2. Now I see why they didn't with the change in the partition numbering.
I just need to read a bit so I can boot my slackware and mepis partitions. Oh and reinstall grub to mepis partition.
I want to thank you again saikee. You have been very helpful to mylittle project to see if the 9.10 ubuntu works woit my intel graphics card and it does.
Thanks, Kevin.
panther3e
09-12-2009, 03:21 PM
After doing a fair amount of reading I was very confused. The grub2 documation needs some work. So I thought I would run grub-update. I was very surprised when it listed all of my linux partitions. I was sure I would have to add them manually.
Kevin.
saikee
09-12-2009, 08:36 PM
I have not got myself into Grub2 because there is no Grub manual at all. Just a draft without even a full list what is inside. You have to know a fair bit of Grub1 just to get by and there is a significant amount of changes. I started to look at Grub2 because you sought help.
My advice is you can stick with whatever version of Grub in each Linux. Every one can be boot indirectly using chainloading so it doesn't matter as long as you know how to put Grub, both Grub1 and Grub2, into the Linux own partition.
I think Grub2 is moving with the advance in the MS systems so may be in long term it will become a powerful boot loader. At the moment it isn't fully developed yet. It is shipped with Ubuntu 9.10 and not before.
Grub2 has been in this state for several years and did not attract any distro to use it until recently.
panther3e
09-12-2009, 11:47 PM
I very much appreciate that saikee. I had tried all of your suggestions and was never able to get Ubuntu 9.10 with grub to start with chainloading. I tried using a grub boot disk and was not able to get to start it with.
I do not know if it was me, the install, the hardware, or not getting grub installed properly in the root partition. But I was not able to start Ubuntu until I put grub in the mbr.
I did a lot of reading and following different links from you and some from ubuntu forums. I also found more information using google. I took a chance with the update-grub command and it worked out.
From what I read most of the problems that people were having involved two hard drives or usb flash drives. I only have one hard drive with a fairly simple layout.
I do not have anything important on the drive so if I hosed something I would only be out time reinstalling. Granted I would not be happy about it, but I have learned a great deal about partitioning hard drives, installing linux, grub, and chainloading.
I am happy with my setup now. I have Ubuntu 9.10 Karmic Koala with gnome. I have Slackware 13 with kde 4.xx. Lastly I have mepis 8 with kde 3.5. I have each installed for a specific reason in mind.
So thank you very much saikee for all of your help and information.
Kevin.
saikee
09-13-2009, 06:03 AM
I think you should have one more try with booting Grub2 by Grub1.
You way you described makes me think that you have not have seen or understood the edited section of my Grub2 thread (http://www.justlinux.com/forum/showthread.php?t=152790) I wrote after responding to this thread. I put the information in a separate thread because it has been partly shown here and also the information is useful to others. I have a habit in answering questions I tend to refer the posters to my threads.
In a nutshell for another Grub, say Grub1, to boot your Ubuntu 9.10 which has ext4 (which Grub1 cannot read) and Grub2 (which is incompatible with Grub1 and so the two cannot coexist) you must make Ubuntu 9.10 "chainloadable" by restoring/replicating Grub2 in its root partition. This can be in parallel to putting Grub2 in the MBR. You do so by the command
grub-install /dev/sda9
which I have showed at the end of the the above mentioned thread. Thereafter in your Grub1 menu of Mepis the Ubuntu 9.10 should be bootable by Grub1 commands
title Ubuntu 9.10
set root=(hd0,8)
chainloader +1
asuming your Ubuntu has not changed position and still in sda9 in Linux convention and (hd0,8) in Grub convention.
I am confident Grub1 can boot Grub2 by chainloading because I have tries it with several versions of Grub1 even with the oldest Grub 0.91 in my collection.
Would you report the result of such an attempt?
panther3e
09-13-2009, 11:43 AM
I have tried your suggestion to boot grub2 from grub. I installed grub2 to the root partition with the command you supplied.
grub-install /dev/sda9
Then installed grub back to mbr from mepis.
I added ubuntu partition to menu.lst.
title Ubuntu 9.10
set root=(hd0,8)
chainloader +1
Rebooted, selected ubuntu, and then I was greeted with the lines:
chainloader +1
grub
I could not ctrl-alt-del, start editor, or enter commands.
I am able to boot slackware and windows..
I will hold off for now to reinstall grub2 back to the mbr. I would like to work to resolve this issue.
Any ideas saikee? Let me know if you would like to keep trying. If you do let me know if you need any additional information.
Thanks Kevin.
saikee
09-13-2009, 03:04 PM
panther3e,
If you put Mepis Grub1 into the MBR boot it with Grub2 commands of
title Ubuntu 9.10
set root=(hd0,8)
chainloader +1
It has to failed as you described. However if you put Grub1 compatible commands like this
title Ubuntu 9.10
root (hd0,8)
chainloader +1
Then it will work. Hope the above is obvious to you.
However the most important feature of both Grub1 and Grub2 is the ability to boot each system manually and this you must learn because it allows you to talk to Grub directly without going through me.
At a text Grub menu, for both Grub1 and Grub2, pressing the "c" key will get you a Grub prompt right? In a Grub prompt you instruct Grub by commands line by line. The commands you use are exactly those in the menu.lst or grub.cfg with the following exceptions
(1) No need to use the "title" statement
(2) Add "boot" at last as the green light for Grub1 (or Grub2) to fire up the operating system.
The deal here is if Grub doesn't like a line of command you type it will tell you immediately. You can then retype it repeatedly until Grub is happy with it. Remember you can use the "tab" key to get Grub to complete the rest of the line to reduce the amount of typing by you. Also the "upward" direction key can be used by you to recall previous Grub commands you have typed and accepted by Grub
Therefore if you have a Grub1 in the MBR you can manually fire up Ubuntu manually by typing at a Grub prompt
root (hd0,8)
chainloader +1
boot
When you have Ubuntu Grub2 menu up you can press C to get another Grub prompt. You can hop from Grub to Grub, therefore from distro to disto this way without booting a system. Naturally in a Grub prompt you can go back to the MBR by these commands
root (hd0)
chainloader +1
boot in Grub1 or if you are in Grub2 you can use
set root=(hd0)
chainloader +1
boot
The power of Grub is released only if you talk and instruct the bugger this way! Why let Grub drives you round the bend when you can make it your slave?
panther3e
09-13-2009, 05:33 PM
I changed menu.lst back to the way you stated.
title Ubuntu 9.10
root (hd0,8)
chainloader +1
Then I get my original errors
File system type is ext2fs type 0x83
error 13 invalid or unsupported executable format
I also tried to edit from the drub command and added the boot to the last line and got the same errors.
Here is me menu.lst file:
timeout 10
color cyan/blue white/blue
foreground ffffff
background 0639a1
gfxmenu /boot/grub/message
title MEPIS at sda5, newest kernel
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 nomce quiet splash vga=normal
initrd /boot/initrd.img
boot
title MEPIS at sda5, kernel 2.6.27-1-mepis-smp
root (hd0,4)
kernel /boot/vmlinuz-2.6.27-1-mepis-smp root=/dev/sda5 nomce quiet splash vga=normal
initrd /boot/initrd.img-2.6.27-1-mepis-smp
boot
title Microsoft Windows XP Professional at sda1
rootnoverify (hd0,0)
chainloader +1
title Slackware
root (hd0,6)
chainloader +1
title Ubuntu 9.10
root (hd0,8)
chainloader +1
title MEMTEST
kernel /boot/memtest86+.bin
I am really stumped. It looks like my only option that worked is to reinstall karmic and put the bootloader in the mbr.
saikee
09-13-2009, 06:45 PM
Thr error 13 is associated with no boot loader found at the boot sector of the partition specified in the "root" statement. This suggested that your installation of Grub2 in the /dev/sda9 unsuccessful and you should have receive an error message to that effect.
The "grub-install /sda9" is a bash command to be issued at a root terminal inside Ubuntu 9.10 like this
sudo su
grub-install /dev/sda9
The "sudo su" command requires no root password if you are using a Live CD but a root password would be demanded in an installed Ubuntu.
If you issue the grub-install command as a normal user it may not be acted upon by Ubuntu and you will not be told. Just one of the bad points of the Ubuntu distro.
You don't have to reinstall Ubuntu 9.10 Alpha 5 again. You can boot it manually using Grub1. The Task G1 in the last link of my signature has the steps. You will need to modify it for Grub1 because you will "cat" /boot/grub/grub.cfg and not /boot/grub/menu.lst
Edited addition
The proof of the pudding is in the eating so I fire up my own Grub1 menu, press C to get a Grub prompt and booedt up Ubuntu 9,10 Alpha5 using these commands (my Ubuntu 9.10 is in the sda15) so adjust the partition reference to suit your case. The red bits are obtainable by typing the blue bits first and then press the "tab" key for Grub to complete them.
root (hd0,14)
kernel /boot/vmlinuz-2.6.31-9-generic ro root=/dev/sda15
initrd /boot/initrd.img-2.6.31-9-generic
boot
The green bits are Grub commands. If I list the content of /boot by command "ls" it shows the following
saikee@saikee-desktop:~$ ls /boot
abi-2.6.31-9-generic memtest86+.bin
config-2.6.31-9-generic System.map-2.6.31-9-generic
grub vmcoreinfo-2.6.31-9-generic
initrd.img-2.6.31-9-generic vmlinuz-2.6.31-9-generic
I have now added the above as Task K5 in my "Just booting tips."
LInux kernels always start with vmlinuz and the initrd file with initrd so I use Grub to fill in the bit I do not know.
panther3e
09-13-2009, 07:40 PM
When I installed grub to my /dev/hda9 partition I used the sudo install-grub /dev/hda9 command. When it was done I received conformation that grub was installed successfully. There was a warning to the effect that not installing to the mbr was a waste of time. Not an exact quote.
I will try what you suggest and post my results.
Thanks Kevin.
saikee
09-13-2009, 07:55 PM
Your description of Grub2 response was also the one I received so your Grub2 should have been successfully installed.
The method I described in Post #20 does require a Grub1 to have been modified to read Ext4 filing system if your Ubuntu 9.10 Alpha5 uses that filing system. If your Grub1 has been sourced from a recent distro then it would have been modified to cope with the Ext4.
My Grub1 in the hard disk MBR boots it and another Grub1- 0.97 floppy also manages it but the oldest Grub1 0.91 and one from Open Solaris (off CD) Grub1 0.97 failed.
The default filing system used by Ubuntu 9.10 Alpha5 is Ext4 which became part of the kernel starting from 2.6.28 onward. Since your Grub1 has beemn sourced from Mepis and its latest kernel version is 2.6.27 you might have a uphill struggle to get its Grub1 to read a Ext4 filing system which is what my Post #20 is all about. However many earlier kernel have been known to incorporate the Ext4 support well before it was formalised in 2.6.28 kernel. However there is always a possibility Grub1 may get forgotten in the process that will be a classic case of a bug.
panther3e
09-13-2009, 08:12 PM
My Mepis install is ext3. Ubuntu 9.10 in ext4.
I am still reading your #20 post then rereading it. I want to make sure I understand what have written. Not that its unclear. I am getting tired and it is not sinking in as of yet.
I will let you know what happens, Kevin.
saikee
09-13-2009, 08:49 PM
I have added a few more bits to help you to understand the Post #20
The basic technique of booting any Linux manually are the following command
root (disk_No,partition_No)
kernel Kernal_filename ro root=Root_device_name
initrd Ram_disk_filename
boot
The first line is known to you. The 2nd and 3rd lines require the knowledge of the kernel and ramdisk filenames which are stored in /boot but not easy to obtain via a Grub prompt. Thus using the "cat" command listing its content on the screen is one way to see the two filenames.
The other alternative is to use the "tab" key which is a standard feature of Linux. We know the file is called vmlinuz-XXXXXXX and it is in /boot so typing
kernel /boot/vml
and then press the "tab" key will trigger Grub to find a file in /boot that matches the above and Grub will complete it to
kernel /boot/vmlinuz-2.6.31-9-generic
I then add "ro" to denote read only and "root=/dev/sda15" to denote the /boot is in sda15 and then press the return key. If Grub accepts it then there will be no error I can proceed to the next line of command.
Hope this is clearer.
PS In booting Grub actually passes the control to the kernel so it needs (hd0,14) to find it. Once the kernel is in control it no longer uses the Grub naming convention and so root=/dev/sda15 assist it to continue with the booting process. Both "ro" and "root=xxxx" are parameters used by the kernel. These two are the essential one that can fire up a Linux. Most Linux distros in a formal booting use more parameters than the above two bare minimum.
panther3e
09-13-2009, 09:06 PM
Woohooo!!!! Success, finely after several attempts. I started up Slackware, looked at my /boot/grub/grub.cfg. Found the corect kernel and initrd lines. Went back to my mepis install menu.lst file and added them to it. Like how you had it. Saved it, rebooted, and what do you know it started.
I was more than surprised after so many tries did not work. Thank you for all your hard work saikee. I know it has not been easy but you did it.
A quick question though. I think the way I have it added to menu.lst I will have to change the entry when ever I update the kernel version?
I forgot the ro between the kernel name and root. Should I go and add it?
title Ubuntu 9.10
root (hd0,8)
kernel /boot/vmlinuz-2.6.31-10-generic root=/dev/sda9
initrd /boot/initrd.img-2.6.31-10-generic
Thank you very much saikee.
saikee
09-14-2009, 03:37 AM
From my experience the "ro" is needed in most Linux. A few can do without it and sometime if it doesn't work I use "rw". I believe it is just the way the maintainers arranged it. Many Linux distros for safety reason boot up a system by mounting it read-only first. The system is re-mounted once for read-write if it proves safe to do so. That way changes are not made to unbootable systems.
I also notice in Grub2 this has been dropped. May be the newer kernel does it automatically. Therefore if it boots you can arrange it anyway you can.
When an kernel is updated the menu.lst or grub.cfg will be automatically added with the new entry and the existing one will be kept untouched. However the changes will only be done to the Linux's own booting commands and not for multi-booting other distros. Thus you save a lot of hassles if you chainload other systems.
My knowledge is really from comparing the hundred of distros menu.lst and lilo.conf. There is no hard and fast rules.
panther3e
09-15-2009, 06:12 PM
Well, it seems that grub2 does not like playing second fiddle to grub. I had everything set to my liking. I did the updates for ubuntu. When it was almost done a popup apperead. There were several options. The one I chose was to keep the local grub. I thought this was the best choice and would keep things the way they were. I was wrong, after the suggested reboot. To my surprise I was presented with the grub2 menu.
Mepis, slackware, and win2k all start as they should and I will leave it as it is for now. It is working but I was surprised after the reboot.
Kevin.
saikee
09-15-2009, 08:09 PM
I have been reading Grub2 information. Apparently the update does not keep the latest grub.cfg which is generated from /etc/grub.d. Thus one has to tweak the /etc/grub.d to make it permanent. Like I said earlier Grub2 is nowhere near ready but some users are pushing it hard.
barjac
12-10-2009, 04:21 PM
Well, I have just installed Ubuntu 9.10 to sda14 with boot loader in sda14 and I cannot chainload into it from grub legacy (Mandriva)
Same error as panther3e
I am trying to help a user on the Mandriva forum and could not believe that a straight chainload would not work, so I tried it myself.
I am in Ubuntu now by using :-
title Ubuntu 9.10
kernel (hd0,14)/boot/vmlinuz-2.6.31-14-generic BOOT_IMAGE=linux root=UUID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ro splash vga=791 quiet splash
initrd (hd0,14)/boot/initrd.img-2.6.31-14-generic
I am beginning to hate grub2.
I wonder if anyone has any more thoughts on this problem?
barjac
12-10-2009, 04:25 PM
Sorry I meant (hd0,13) I just quickly edited that from another post.
saikee
12-11-2009, 02:08 PM
barjac,
Welcome to Justlinux!
If you chainload a Linux booted by Grib2 you use the command "chainloader +1" in the Grub legacy. This is indirect booting and can only be successful if you have installed Grib2 inside the root partition of your Linux, which is sda14 (in Linux) or (hd0,13) in Grub legacy or (hd0,14) in Grub2. To do this after the Linux has been installed you need to mount sda14 and run Grub-install command.
If you uses the command involving "kernel" and "initrd" commands then you boot that system "directly".
My guess of your difficulty is that Ubuntu 9.10 default filing system is Ext4. Grub legacy cannot read Ext4 so it cannot go inside sda14 to load the kernel and initrd files with the direct booting booting method.
There are many ways to fix your problem. Using a Ubuntu 9.10 CD should be the easiest. Have a read of Post #16 and apply it to your case. If you still have a problem report back.
The commands with a Ubuntu 9.10 CD should be
sudo su
mkdir /mnt/sda14
mount /dev/sda14 /mnt/sda14
chroot /mnt/sda14
grub-install /dev/sda14
exit
The above can be omitted if you think you have installed Grub2 into sda14 as claimed.
You then mount the Mandriva partition (if you use Ubuntu CD, no need to mount if you can boot Mandriva) and amend its Grub legacy menu.lst with the following insertions
title My Ubuntu 9.10 in sda14 or (hd0,13)
root (hd0,13)
chainloader +1
Reboot and you should be able to boot Ubuntu 9.10.
barjac
12-12-2009, 08:59 AM
My guess of your difficulty is that Ubuntu 9.10 default filing system is Ext4. Grub legacy cannot read Ext4 so it cannot go inside sda14 to load the kernel and initrd files with the direct booting booting method.
Thanks for your reply. I am new to grub2 and Ubuntu but quite conversant with grub.
Mandriva legacy grub supports ext4 and I have no problem booting directly into a kernel, however this is not a long term solution as any kernel updates would have to be manually changed in the legacy menu.lst. I want to chainload into grub2 so the grub2 menu will be displayed giving the option of older kernels etc. as I do with other Linux legacy grub installations.
I reported a bug on this and just got a reply here :- http://savannah.gnu.org/bugs/?28256
I am not sure what that will do, if it uses a symlink to boot the current kernel, then that would be adequate. I will re-install Ubuntu again - putting the boot loader in the root as before and see what this gives.
All your suggestions mirror exactly the approach that I had used.
saikee
12-12-2009, 03:24 PM
barjac,
OK so you can boot Ubuntu 9.10 directly with Mandriva's Grub legacy. It is true some versions of Grub legacy were updated to read Ext4.
So your problem is grub-install failed no matter how hard you try. May be you can show us the grub.cfg of Grub2.
My experience with Grub2's grub-install command is that it isn't reliable and sometimes requires more than one attempt. I did managed to chainload Grub2 with the oldest Grub I have which is 0.91 sourced from Damn Small Linux. I still think Grub2 can be chainloaded by any version of Grub legacy.
barjac
12-12-2009, 05:05 PM
Thanks for your encouragement, however I am getting nowhere with the chainload.
I just re-installed Ubuntu 9.10 into a clean re-formatted ext3 partition (sda14 again).
Despite telling it to install the boot loader on sda14 it will not chainload.
I can boot to the grub2 menu using
root (hd0,13)
kernel /boot/grub/core.img
From within Ubuntu I also ran sudo grub-install /dev/sda14which reported no errors, and still it won't chainload!
I'm not sure what happened to the bug report, as they closed it without waiting for my comments, I replied anyhow.
grub.cfg is here (http://barjac.pastebin.com/f2c6ad75e)
saikee
12-13-2009, 10:35 AM
I have checked your grub.cfg and could not fault it.
My Ubuntu 9.10 has also been updated some time ago and my Grub2 floppy seems to have an issue of booting it now, saying the "signature" not the same. Perhaps Grub2 1.97 Beta1 has been updated but not in a full working order.
My grub.cfg is listed here
root@saikee-desktop:/home/saikee# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set default=0
insmod ext2
set root=(hd0,16)
search --no-floppy --fs-uuid --set 0e4d2e7c-f6be-40fe-b4ac-e527256573ca
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
set timeout=10
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-9-generic" {
insmod ext2
set root=(hd0,16)
search --no-floppy --fs-uuid --set 0e4d2e7c-f6be-40fe-b4ac-e527256573ca
linux /boot/vmlinuz-2.6.31-9-generic root=UUID=0e4d2e7c-f6be-40fe-b4ac-e527256573ca ro quiet splash
initrd /boot/initrd.img-2.6.31-9-generic
}
menuentry "Ubuntu, Linux 2.6.31-9-generic (recovery mode)" {
insmod ext2
set root=(hd0,16)
search --no-floppy --fs-uuid --set 0e4d2e7c-f6be-40fe-b4ac-e527256573ca
linux /boot/vmlinuz-2.6.31-9-generic root=UUID=0e4d2e7c-f6be-40fe-b4ac-e527256573ca ro single
initrd /boot/initrd.img-2.6.31-9-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set d6b03e6ab03e50eb
chainloader +1
}
menuentry "openSUSE 11.2 Milestone 1 (x86_64) (on /dev/sda12)" {
insmod ext2
set root=(hd0,12)
search --no-floppy --fs-uuid --set 264ff887-c033-4178-a195-2712aa822945
linux /boot/vmlinuz-2.6.29-6-default root=/dev/sda12
initrd /boot/initrd-2.6.29-6-default
}
menuentry "openSUSE 11.2 Milestone 1 (x86_64) (on /dev/sda12)" {
insmod ext2
set root=(hd0,12)
search --no-floppy --fs-uuid --set 264ff887-c033-4178-a195-2712aa822945
linux /boot/vmlinux-2.6.29-6-default.gz root=/dev/sda12
}
menuentry "Mandriva Linux 2009.1 (2009.1) (on /dev/sda13)" {
insmod ext2
set root=(hd0,13)
search --no-floppy --fs-uuid --set f6269276-592b-4aac-ae1c-14dfbe448b33
linux /boot/vmlinuz-2.6.28.4-desktop-1mnb root=/dev/sda13
}
menuentry "Debian GNU/Linux (5.0) (on /dev/sda14)" {
insmod ext2
set root=(hd0,14)
search --no-floppy --fs-uuid --set aed5e0bc-1ce3-46c6-b236-40e08878cc9b
linux /boot/vmlinuz-2.6.26.8-elive-686 root=/dev/sda14
initrd /boot/initrd.img-2.6.26.8-elive-686
}
menuentry "Bluewhite64 (on /dev/sda15)" {
insmod ext2
set root=(hd0,15)
search --no-floppy --fs-uuid --set 851cf392-5507-46b2-8b00-e86f5211024b
linux /boot/vmlinuz root=/dev/sda15 ro vga=773
}
menuentry "Windows NT/2000/XP (loader) (on /dev/sda18)" {
insmod ntfs
set root=(hd0,18)
search --no-floppy --fs-uuid --set 70a4ff53a4ff19f4
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "CentOS release 5.3 (Final) (on /dev/sda19)" {
insmod ext2
set root=(hd0,19)
search --no-floppy --fs-uuid --set 36f7fbf2-8592-46b0-a8d0-7258187b0de3
linux /boot/vmlinuz-2.6.18-128.1.6.el5 root=/dev/sda19
}
menuentry "CentOS release 5.3 (Final) (on /dev/sda19)" {
insmod ext2
set root=(hd0,19)
search --no-floppy --fs-uuid --set 36f7fbf2-8592-46b0-a8d0-7258187b0de3
linux /boot/vmlinuz-2.6.18-128.1.6.el5.centos.plus root=/dev/sda19
}
menuentry "CentOS release 5.3 (Final) (on /dev/sda19)" {
insmod ext2
set root=(hd0,19)
search --no-floppy --fs-uuid --set 36f7fbf2-8592-46b0-a8d0-7258187b0de3
linux /boot/vmlinuz-2.6.18-128.el5 root=/dev/sda19
}
menuentry "Ubuntu 9.04 (9.04) (on /dev/sda20)" {
insmod ext2
set root=(hd0,20)
search --no-floppy --fs-uuid --set 1a8f8477-1d35-4ea1-9d6b-b79a6c551dd5
linux /boot/vmlinuz-2.6.28-11-generic root=/dev/sda20
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Ubuntu 9.04 (9.04) (on /dev/sda20)" {
insmod ext2
set root=(hd0,20)
search --no-floppy --fs-uuid --set 1a8f8477-1d35-4ea1-9d6b-b79a6c551dd5
linux /boot/vmlinuz-2.6.28-8-generic root=/dev/sda20
initrd /boot/initrd.img-2.6.28-8-generic
}
menuentry "Debian GNU/Linux (5.0) (on /dev/sda25)" {
insmod ext2
set root=(hd0,25)
search --no-floppy --fs-uuid --set 2b6302dd-47d4-4d3a-af8d-42e6e3ecec3a
linux /boot/vmlinuz-2.6.28-5.slh.3-sidux-686 root=/dev/sda25
initrd /boot/initrd.img-2.6.28-5.slh.3-sidux-686
}
menuentry "Frugalware 1.0 (Anacreon) (on /dev/sda28)" {
insmod ext2
set root=(hd0,28)
search --no-floppy --fs-uuid --set 41c4739e-6cea-46cd-9056-69487e50e74e
linux /boot/vmlinuz-2.6.28-fw5 root=/dev/sda28
}
menuentry "Linux (on /dev/sda29)" {
insmod ext2
set root=(hd0,29)
search --no-floppy --fs-uuid --set 4c9a3608-80a9-46f7-9c43-a929a8d823b9
linux /boot/vmlinuz root=/dev/sda3 ro vt.default_utf8=0 vga = 773
}
menuentry "Windows NT/2000/XP (loader) (on /dev/sda31)" {
insmod ntfs
set root=(hd0,31)
search --no-floppy --fs-uuid --set 70a4ff53a4ff19f4
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows NT/2000/XP (loader) (on /dev/sda33)" {
insmod ntfs
set root=(hd0,33)
search --no-floppy --fs-uuid --set 70a4ff53a4ff19f4
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Absolut (on /dev/sda35)" {
insmod ext2
set root=(hd0,35)
search --no-floppy --fs-uuid --set d2b0044d-a64d-4ac4-83db-615b48f5359f
linux /boot/vmlinuz root=/dev/sda35 ro vga = 773
}
menuentry "Debian GNU/Linux (5.0) (on /dev/sda36)" {
insmod reiserfs
set root=(hd0,36)
search --no-floppy --fs-uuid --set 3e2219fd-020d-4972-92f2-4b0a56d6f049
linux /boot/vmlinuz-2.6.28.7 root=/dev/sda36
initrd /boot/initrd.img-2.6.28.7
}
menuentry "Slackware Linux (Slackware 12.2.0) (on /dev/sda37)" {
insmod ext2
set root=(hd0,37)
search --no-floppy --fs-uuid --set 416595ae-e0bc-4788-8dd0-5496d09df118
linux /boot/vmlinuz root=/dev/sda37
}
menuentry "Slackware Linux (Slackware 12.2.0) (on /dev/sda37)" {
insmod ext2
set root=(hd0,37)
search --no-floppy --fs-uuid --set 416595ae-e0bc-4788-8dd0-5496d09df118
linux /boot/vmlinuz root=/dev/sda37
}
menuentry "Zenwalk (on /dev/sda43)" {
insmod ext2
set root=(hd0,43)
search --no-floppy --fs-uuid --set 751890c6-9fca-4aa7-ab19-f67a488d9fec
linux /boot/vmlinuz root=/dev/sda58 ro resume=/dev/sda5 splash=silent vga = 775
initrd /boot/initrd.splash
}
menuentry "Linux (on /dev/sda45)" {
insmod ext2
set root=(hd0,45)
search --no-floppy --fs-uuid --set 8aa84056-aaa5-4d4e-9de4-ee3b6f429f17
linux /boot/vmlinuz root=/dev/sda45 ro vt.default_utf8=0 vga = 773
}
menuentry "Mandriva Linux 2009.1 (2009.1) (on /dev/sda47)" {
insmod ext2
set root=(hd0,47)
search --no-floppy --fs-uuid --set bced517e-f1bd-48ee-8f3d-9a0f7fa6bf5a
linux /boot/vmlinuz-2.6.29-desktop586-1mnb root=/dev/sda47
}
menuentry "PCLinuxOS release 2009 (PCLinuxOS) for i586 (on /dev/sda49)" {
insmod ext2
set root=(hd0,49)
search --no-floppy --fs-uuid --set f3ec3b23-6ab3-4650-8595-5d43dd722c06
linux /boot/vmlinuz-2.6.26.8.tex3 root=/dev/sda49
}
menuentry "Ubuntu jaunty (development branch) (9.04) (on /dev/sda53)" {
insmod ext2
set root=(hd0,53)
search --no-floppy --fs-uuid --set 26b0929c-e1b2-4f34-8352-80ed0b780bc1
linux /boot/vmlinuz-2.6.28-11-generic root=/dev/sda53
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "BigLinux (5.0alpha) (5.0alpha) (on /dev/sda54)" {
insmod ext2
set root=(hd0,54)
search --no-floppy --fs-uuid --set e5b760d6-930c-4bfc-bcd8-2f1023131e76
linux /boot/vmlinuz-2.6.28-11-generic root=/dev/sda54
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "arch (on /dev/sda55)" {
insmod ext2
set root=(hd0,55)
search --no-floppy --fs-uuid --set 7ac6831d-1793-468c-9e37-6b50564ad427
linux /boot/vmlinuz26 root=/dev/hda3 ro
initrd /boot/kernel26.img
}
menuentry "arch-fallback (on /dev/sda55)" {
insmod ext2
set root=(hd0,55)
search --no-floppy --fs-uuid --set 7ac6831d-1793-468c-9e37-6b50564ad427
linux /boot/vmlinuz26 root=/dev/hda3 ro
initrd /boot/kernel26-fallback.img
}
menuentry "Debian GNU/Linux (5.0) (on /dev/sda56)" {
insmod ext2
set root=(hd0,56)
search --no-floppy --fs-uuid --set 38d4cdfc-e2d5-464f-aad4-f1fe1be7744b
linux /boot/vmlinuz-2.6.28-5.slh.3-sidux-686 root=/dev/sda56
initrd /boot/initrd.img-2.6.28-5.slh.3-sidux-686
}
menuentry "Ubuntu jaunty (development branch) (9.04) (on /dev/sda57)" {
insmod ext2
set root=(hd0,57)
search --no-floppy --fs-uuid --set 3b0bb9a2-3ba8-4fa5-8f03-9fe548822c1c
linux /boot/vmlinuz-2.6.28-11-generic root=/dev/sda57
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Debian GNU/Linux (5.0) (on /dev/sda9)" {
insmod ext2
set root=(hd0,9)
search --no-floppy --fs-uuid --set 9b669750-5ca8-4eb2-90f3-083547934355
linux /boot/vmlinuz-2.6.26-1-686 root=/dev/sda9
initrd /boot/initrd.img-2.6.26-1-686
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file is an example on how to add custom entries
### END /etc/grub.d/40_custom ###
If there is a bug in Grub2 then it isn't in my current kernel version as I can boot Ubuntu 9.10's Grub 2 up with
(1) Grub legacy 0.97 sourced from an earlier version of Ubuntu and Mandriva
(2) Grub legacy 0.91 from the oldest version of Grub I have
In both the above case Ubuntu 9.10 Grub2 menu can be booted manually by commands
root (hd0,15)
chainloader +1
boot
Once I have Grub2 of Ubuntu 9.10 I can boot up Ubuntu. However if I drop into a Grub prompt I can use Ubuntu's Grub2 to boot it up again manually using either
root = (hd0,16)
chainloader +1
boot
or
root = (hd0,16)
configfile /boot/grub/grub.cfg
boot
My conclusion is any Grub legacy should be able to boot Grub2 by chainloading. To use Grub2 to chainload another Grub2 then a correct version with compatible signature may be needed.
barjac
12-13-2009, 07:41 PM
My conclusion is any Grub legacy should be able to boot Grub2 by chainloading.That would be what I would expect too, but I will have to take your word for it, as it just will not work for me. I will continue to play with it as time allows, but it's not so important now that it is possible to boot into core.img and get to the menu.
Just annoying, combined with the fact that Ubuntu won't install without re-formatting swap. I was only installing it to test the chainloader and it screwed my Mandriva install when the swap UUID changed, took a while to edit fstab, menu.lst and recreate initrd. I won't be recommending Ubuntu in a hurry!
woodnymph
01-02-2010, 11:46 PM
hey, just came across this thread ..
i am currently running ubuntu karmic and linux mint as dual boot .. both use grub2.
i am wanting to install mandriva or fedora on a third partition, both use grub legacy (just for kicks and to check them out).
i'm newby with grub, but have read enough to see that grub1 & 2 dont care for each other - which seems ridiculous to me, whos writing this .. ??
anyway. maybe best to just not mix the grubs on one disc .. ? or is there a good way to add a new install partition and minimize/work around this conflict? thx for any advice.
saikee
01-03-2010, 06:58 AM
woodnymph,
Welcome to Justlinux!
Don't worry about mixing Grub2 with Grub legacy.
The majority partitions used in a PC by default leave the front end with a boot sector for the residence of the boot loader. You can have any PC operating system installed with its boot loader in a reserved location. That boot sector will not be used for any other purpose.
If you want Grub2 to be booted by another boot loader, say Lilo, NTLDR (from Xp and Win2k) or bootmgr (from Vista or Win7) or Grub legacy all you need is to ensure the boot loader is "replicated" or "installed" or "duplicated" inside the boot sector using the command "grub-install" which is identical for both Grub2 and Grub legacy. Thereafter that OS will be "chainloadable" by any boot loader.
In chainloading you use one boot loader to boot up another boot loader. Every OS will become chainloadable if you arrange its boot loader inside the boot sector the OS resides.
You can mix Grub2 and Grub legacy in the same way of mixing Linux and MS systems inside the same hard disk.
You can have say 10 OSes installed and everyone has its boot loader inside its boot sector (generally referred as having the boot loader installed in its root partition) then you can select anyone of them to control the MBR and boot all the rest. This is your God given right! Even MS systems can do this but it is a lot easier and simple with Linux.
barjac
01-03-2010, 01:38 PM
It is generally preferable to install Mandriva from the "Free" DVD, but the "One" live CD has all the drivers for virtually all hardware on the disk and includes an installer. "One" comes in two flavours, KDE4 and Gnome. "Free" includes both of these and more, plus lots more software.
During the installation, towards the end, Mandriva offers choces of where to install the boot loader.
If you opt for the MBR then you will boot into Mandriva grub and need to manually add entries to that for any grub2 systems like Ubuntu.
If you select the root partition for the boot loader, then you will need to chainload into Mandriva from your existing boot manager.
Either way will work, however it's worth re-reading this thread several times in conjunction with the grub and grub2 manuals first, just to get familiarized with the differences.
Have Fun!
janb
10-13-2010, 01:41 AM
hi saikee and all,
i haven't been around the justlinux.com website in sometime, but when it comes to multi-booting and writing the menu.lst file, as per grub legacy, or now the grub.cfg file, as per grub2 i've found you are the indisputable expert. so here goes:
i've got an ok linux desktop with 6 installed distros (2 using legacy grub with ext3 fs and 4 using grub2 with ext4 fs) using the direct booting method.
my question: is it possible to convert this system to indirect booting with chainloader +1 without disturbing the already installed distros, and if so how would one go about writing the grub.cfg file? would a fat16 data-only partition
still be used?
thanks for any help.
saikee
10-13-2010, 07:20 PM
Indirect booting is a lot easier than direct booting.
There are two steps.
Step 1 : Grub-install either Grub1 (legacy grub) or Grub2 within the distro partition.
Say you want Grub1 inside partition sda3 the command in Linux is
grub-install /dev/sda3
for Grub2 it is
grub-install -force /dev/sda3
Step 2 : Amend the menu.lst (for Grub1) or grub.cfg (for Grub2)
Say you have a distro installed in sda3 which will be known as (hd0,2) in Grub1 but (hd0,3) in Grub2, so the lines to boot in in Grub1 are just
title Distro in sda3 known to Grub1 as (hd0,2)
root (hd0,2)
chainloader +1
For Grub2 it is just
menuentry 'Distro in sda3 known to Grub2 as (hd0,3)' {
set root=(hd0,3)
chainloader +1
}
In the indirect booting the Grub (can be either Grub1 or Grub2) in MBR simply boot up anther Grub (which can be Grub1 or Grub2 also or Lilo or a MS Windows) in the partition specified. The second Grub then boot up its own master "directly".
janb
10-14-2010, 12:41 AM
saikee,
ok, this is great. but, 2 more 3 related questions occur to me:
--how do you change the grub.cfg file since it is not editable, as the menu.lst file is? can you give some details.
--and is the small fat16 data partition containing the edited grub.cfg file rather than the menu.lst file no longer necessary?
thanks again.
saikee
10-14-2010, 06:11 AM
grub.cfg can be edited just like menu.lst.
It is just a text file. Some distros like Ubuntu make a meal out of it by saying not to touch it.
Every operating system must be booted directly eventually. This means if you have a distro having its Grub occupying the MBR then you cannot chainload that distro. It is like asking a dog to chase its own tail. If you think about it then the logic makes sense.
My purpose of using a data-only, say a fat16, partition to house Grub that controls the MBR is to have every operating system booted by chainloading. The data-only fat16 partition has no operating system inside and no need to boot it. This makes it easy to compile a menu.lst by just repeating the chainloading commands as many times as the number of partitions.
The new Grub2 is more versatile in that it can read a NTFS partition. Therefore you can put Grub2 inside any Win2k, Xp, Vista or Win7 now to boot every system in the box. Vista and Win7 also have a \boot subdirectory ideally suitable for adding \boot\grub to it for this trick.
wayne128
10-14-2010, 07:05 AM
greeting,
I have just started learning Linux.
And currently learning multi boot with grub.
So I navigated to here and want to start here.
As there are so many type of Linux OS, so far I have come across Lilo, grub and grub2 boot loader on those OS I read and played with. So I would like to learn a good, long term method to boot all of them in multi-boot environment.
The other thing I would like to learn is, some computers I have do not have CD/DVD or its old CDROM/DVD are no longer working. I hope I can learn also the proper way to prepare bootable USB stick, bootable USB external drives and boot iso directly from hard disk.
I have not yet navigate this forum, so I just start here, if this is not appropriate kindly let me know and channel me to the right place
thank you.
janb
10-14-2010, 11:25 AM
saikee,
great, that does it all for me.
i'm amazed that something so simple when one finally understands it eluded so many seasoned linux users and "experts" for years until you cam along.
i nominate you for the noble prize in linux!!
thanks again.
saikee
10-14-2010, 08:55 PM
janb,
We all Linux here. I might shout a bit louder than others to say Grub is simple and easy.
JohnT
10-17-2010, 09:42 PM
Here's (https://help.ubuntu.com/community/Grub2)some good documentation Grub Legacy and 2.....very informative and helpful.
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.