Author Topic: cannot add pclinuxos to grub of other os  (Read 1222 times)

Offline dmt

  • Jr. Member
  • **
  • Posts: 21
cannot add pclinuxos to grub of other os
« on: June 15, 2012, 06:36:11 AM »
Hi all

I reinstalled pclinuxos on my desktop and used grub of another os to try to boot.  I did this as pclinuxos was not booting again from other os.  It kept coming back this a kernel panic.  Trouble is even with full reinstall the kernel panic remains.  So the question is why can one not boot from other os even though correctly setup? ???

Another thing about the grub in pclinuxos.  If I use thast then certain other os's will not boot.  For instance cannot boot slackware even though the grub file is correctly setup.  I also have not seen in grub before the "BOOT_IMAGE=linux".  I dont see the point of this.  I have not come across this in grub before and I was wondering if this is stopping the booting of other os's as its not correctly written - either by me or pclinuxos.  Could this be explained.

cheers :)

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15515
  • ┌∩┐(◕_◕)┌∩┐
Re: cannot add pclinuxos to grub of other os
« Reply #1 on: June 15, 2012, 06:48:36 AM »
Quote
either by me or pclinuxos.

Well, I know which one I'd pick  ;)  ;D

Mebbe the other OS's are using Grub2 whereas PCLinuxOS uses the more stablle Grub1.

Could try booting  a LiveCD and use the redo-mbr (Kmenu > More Applications > Configuration)
PCLinuxOS 32bit KDE 4.10.4; kernel-3.4.11-pclos1.bfs & 64bit 3.4.38bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Offline dmt

  • Jr. Member
  • **
  • Posts: 21
Re: cannot add pclinuxos to grub of other os
« Reply #2 on: June 15, 2012, 07:00:28 AM »
Quote
either by me or pclinuxos.

Well, I know which one I'd pick  ;)  ;D

Mebbe the other OS's are using Grub2 whereas PCLinuxOS uses the more stablle Grub1.

Could try booting  a LiveCD and use the redo-mbr (Kmenu > More Applications > Configuration)

I am not convinced that grub-2 is the problem - yes grub2 is used by these other os's - as all other os's are pcked up by the grub2 in these other os's.  Even pclinuxos is picked up.  Still kernel panic is the result. :)

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3339
  • Satellite Station Africa
Re: cannot add pclinuxos to grub of other os
« Reply #3 on: June 15, 2012, 07:45:41 AM »
I am fairly convinced that grub 2 is the problem.  If you do a search you will find many posts like yours.  I - for one - always use grub legacy and add the distros using grub 2 to my menu.list and not install grub 2 .  It never failed.
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Online DeBaas

  • Hero Member
  • *****
  • Posts: 1535
    • PCLinuxOS.nl
Re: cannot add pclinuxos to grub of other os
« Reply #4 on: June 15, 2012, 08:56:21 AM »
As always Grub2 is translating the /boot/grub/menu.lst from PCLinuxOS in a wrong way.
The best solution is:
During install of "TheOtherOS" install it's Grub BootLoader on the partition of "TheOtherOS"
Now boot up your PCLinuxOS and add the correct stanza in /boot/grub/menu.lst as in, example:

title TheOtherOS
root (hd0,6)
chainloader +1

Where hd0 is your HDD counting from 0, second HDD is hd1 etc.
and 6 is the partition, also counting from 0.

Grub 1/legacy is counting from (hd0,0) where Grub2 is counting from (hd0,1)
If you ensist using Grub 2 as bootloader change in PCLinuxOS's /boot/grub/menu.lst,
lines containing (hdx,y) to (hdx,y+1) and redo/update grub2 from whithin "TheOtherOS"

Personaly I think the PCLinuxOS Redo MBR (also on the install CD) is the best option.
For Vista/W7 there is EasyBCD.

Offline dmt

  • Jr. Member
  • **
  • Posts: 21
Re: cannot add pclinuxos to grub of other os
« Reply #5 on: June 15, 2012, 09:05:41 AM »
Hi all

I dont think I got across the problem correctly or its being lost in translation.

If I let pclinuxos install its version of grub to the mbr and then add say slackware to its code, slackware will not boot.

If I let say debian that uses grub 2 to list and then install its grub to the mbr pclinuxos will not boot with a kernel panic.

if I install pclinuxos and then place grub bootloader into its own partition then again let the other os add pclinuxos to its grub and then install that to the mbr pclinuxos still ends in kernel panic.

I as I said above I have not seen this "BOOT_IMAGE=linux" that is in the pclinuxos.  Does this have something to do with the errors.

cheers :)

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: cannot add pclinuxos to grub of other os
« Reply #6 on: June 15, 2012, 09:38:48 AM »
Hi all

I dont think I got across the problem correctly or its being lost in translation.

If I let pclinuxos install its version of grub to the mbr and then add say slackware to its code, slackware will not boot.


Please post /boot/grub/menu.lst from your PCLinuxOS install so that we can see precisely what you've added. Slackware should be chainloaded, but chainloading it may need a syntax that differs from the ordinary one.

See
http://www.dedoimedo.com/computers/grub-2.html
Slackware's bootloader must be installed on the partition, not in MBR. Then the PCLinuxOS menu.lst needs a stanza like

Code: [Select]
title Other_Distro
root (hdX,Y)
kernel /boot/grub/core.img
savedefault
boot

I can't test it for the moment, because I don't have any distros that use GRUB 2.

Quote
If I let say debian that uses grub 2 to list and then install its grub to the mbr pclinuxos will not boot with a kernel panic.

if I install pclinuxos and then place grub bootloader into its own partition then again let the other os add pclinuxos to its grub and then install that to the mbr pclinuxos still ends in kernel panic.

I as I said above I have not seen this "BOOT_IMAGE=linux" that is in the pclinuxos.  Does this have something to do with the errors.

cheers :)


Did you take DeBaas' advice?
« Last Edit: June 15, 2012, 10:17:21 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline dmt

  • Jr. Member
  • **
  • Posts: 21
Re: cannot add pclinuxos to grub of other os
« Reply #7 on: June 19, 2012, 02:21:57 AM »
I think I have solved this by not using the grub that ships with pclinuxos.  I installed grub1 to slackware and here I am writing this from pclinuxos.

But this is not a fix for the grub that ships with pclinuxos - thats still broken/faulty.

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 11064
  • MLUs Forever!
Re: cannot add pclinuxos to grub of other os
« Reply #8 on: June 19, 2012, 03:28:55 AM »
I think I have solved this by not using the grub that ships with pclinuxos.  I installed grub1 to slackware and here I am writing this from pclinuxos.

But this is not a fix for the grub that ships with pclinuxos - thats still broken/faulty.

 ;D
MLUs rule the roost!

Linux XPS 3.4.48-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline hal8000

  • Sr. Member
  • ****
  • Posts: 346
Re: cannot add pclinuxos to grub of other os
« Reply #9 on: June 20, 2012, 02:36:35 PM »
I think I have solved this by not using the grub that ships with pclinuxos.  I installed grub1 to slackware and here I am writing this from pclinuxos.

But this is not a fix for the grub that ships with pclinuxos - thats still broken/faulty.


PCLinuxOS uses grub legacy, its not broken and works for all of us.
When you add another linux system, you can choose not to install grub, in which case you manually
create a new stanza in grub menu.lst.

If you let the new OS install grub, then it will overwrite your existing grub.
Grub2 that some distros use,  uses a script called os-proper to detect other operating systems.
This script  is broken and fails to properly detect any system using grub legacy.

If you use grub2, you can disable os-prober and write manual entries for each system, this is the
only way I got grub2 working. However, there was little to be gained from grub2 and the next
progression is burg, as at least you can use icons to boot each system unlike grub2.


If you need help repairing grub legacy in PClinux then you need to post your menu.lst from PClinux and the output of:
fdisk -l  (as root)
blkid

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6224
  • I don't do Windows
Re: cannot add pclinuxos to grub of other os
« Reply #10 on: June 21, 2012, 04:50:07 AM »

I also have not seen in grub before the "BOOT_IMAGE=linux".  I dont see the point of this.  I have not come across this in grub before and I was wondering if this is stopping the booting of other os's as its not correctly written - either by me or pclinuxos.  Could this be explained.


It is a kernel parameter and is commonly used in Fedora and Mandriva boot stanzas.  


I am not convinced that grub-2 is the problem - yes grub2 is used by these other os's - as all other os's are pcked up by the grub2 in these other os's.  Even pclinuxos is picked up.  Still kernel panic is the result. :)


GRUB2 is the problem. It is a rewrite of GRUB legacy (version 0.97), which was supposedly done to enable booting of UEFI disks. In doing so, the GNU artistes created an over-complicated bootloader that doesn't always do what it's intended to do. When a new OS is added to the GRUB2 (version 1.99) setup, a special routine is run. In TheOtherOS, that routine is kept in the file /etc/grub.d/30_os-prober. When the os-prober runs, it is not smart enough to determine whether the OS to be added to the GRUB2 menu already has a bootloader of its own, and whether or not that bootloader may be legacy GRUB. Instead, the os-prober routine simply tries to boot the added OS directly, using GRUB2 boot parameters. When you added PCLinuxOS to the GRUB2 setup of TheOtherOS, you got a menu that looks like this:

(click on any thumbnail to see a full sized version)



You ended up with a section in the /boot/grub/grub.cfg file that looks like this:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "linux (on /dev/sda3)" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos3)'
   search --no-floppy --fs-uuid --set=root 06a09f8e-ec6f-449d-b0d6-33e1e116dcab
   linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=06a09f8e-ec6f-449d-b0d6-33e1e116dcab quiet vmalloc=256M acpi=on resume=UUID=150f890d-e3e7-46b9-8d44-431f1572b007 splash=silent vga=788
   initrd (hd0,2)/boot/initrd.img
}
menuentry "linux-nonfb (on /dev/sda3)" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos3)'
   search --no-floppy --fs-uuid --set=root 06a09f8e-ec6f-449d-b0d6-33e1e116dcab
   linux /boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=06a09f8e-ec6f-449d-b0d6-33e1e116dcab quiet vmalloc=256M acpi=on resume=UUID=150f890d-e3e7-46b9-8d44-431f1572b007
   initrd (hd0,2)/boot/initrd.img
}
menuentry "failsafe (on /dev/sda3)" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos3)'
   search --no-floppy --fs-uuid --set=root 06a09f8e-ec6f-449d-b0d6-33e1e116dcab
   linux /boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=06a09f8e-ec6f-449d-b0d6-33e1e116dcab quiet failsafe vmalloc=256M acpi=on
   initrd (hd0,2)/boot/initrd.img
}
### END /etc/grub.d/30_os-prober ###


That is completely wrong. You cannot correctly boot an OS using GRUB2 if the bootloader and configuration files for that OS are using GRUB legacy. It will not work, period. You already discovered this from trying to boot PCLinuxOS from the entries the GRUB2 bootloader created.

GRUB legacy has a tried and true method for passing control from the GRUB1 bootloader to a second bootloader. It is a simple one-line boot stanza:

chainloader +1

GRUB2 has exactly the same capability, but I've yet to see it used by the GRUB2 utilities. You must manually edit the /boot/grub/grub.cfg as superuser to get the functionality you need. This is something the GRUB2 configuration utilities should already do, but don't. At the very top of the file is this section:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


What a crock. To boot PCLinuxOS correctly from TheOtherOS, delete the entire /etc/grub.d/30_os-prober section shown in red above, and replace it with this much simpler section, shown below in green.

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Chainload PCLinuxOS on /dev/sda3" {
   set root='(hd0,3)'
   chainloader +1
}

### END /etc/grub.d/30_os-prober ###


You will then see a GRUB2 boot menu that looks similar to this:



If you select "Chainload PCLinuxOS on /dev/sda3" from the GRUB2 menu, you will then see this:



Exactly what you should see in the first place if GRUB2 did its job correctly. In the examples shown here, TheOtherOS was installed first. The GRUB2 boot record was written to the MBR of device sda and the configuration files are in partition sda2. PCLinuxOS was installed last. The GRUB1 boot record was installed to sda3 and the config files are in sda3. TheOtherOS's root partition is sda2, PCLinuxOS's root partition is sda3, and both share the swap partition on sda1. The original /boot/grub/menu.lst generated by the PCLinuxOS setup and stored in the /dev/sda3 partition is still untouched. Not one single change has been made to it.

There is another GRUB2 configuration file at /etc/grub.d/40_custom. You will see the corresponding section in grub.cfg immediately following the section explained above. It is designed to be an "easy" way to (manually) add GRUB2 boot entries when GRUB2 is re-generated. You would, as superuser, simply add the menu entry shown in green in the grub.cfg example above to the end portion of /etc/grub.d/40_custom. However, the os-prober will still run when GRUB2 is re-generated, and you would end up with the following:

"linux (on /dev/sda3)"
"linux-nonfb (on /dev/sda3)"
"failsafe (on /dev/sda3)"
"Chainload PCLinuxOS on /dev/sda3"


Three wrong entries and one correct one, all pointing to the same partition. Now you tell me. Which bootloader has the real problem? GRUB1 or GRUB2?


I think I have solved this by not using the grub that ships with pclinuxos.  I installed grub1 to slackware and here I am writing this from pclinuxos.

But this is not a fix for the grub that ships with pclinuxos - thats still broken/faulty.


I have to disagree. Completely. No matter where you got the copy of GRUB1 from, if it is a working copy of GRUB version 0.97, I guarantee that it is a byte for byte exact copy of the GRUB1 used by PCLinuxOS. The question is, where did that copy of GRUB1 come from? It did not come from Slackware. They still use LILO as the bootloader.



« Last Edit: June 21, 2012, 03:25:04 PM by djohnston »
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline dmt

  • Jr. Member
  • **
  • Posts: 21
Re: cannot add pclinuxos to grub of other os
« Reply #11 on: July 04, 2012, 06:35:19 AM »
@djonston - thanks for the time and trouble for answering with all that you did answer with.

In the end I installed lilo onto the mbr through slackware, and added pclinuxos to that.  However this did not work.  There were two problems.  The first came to having to wait for 1 minute for the root and swap partitions (each) - from what I can gather the solution to this would be to do with redoing the inintrd.img.  The second was that even past the first problem it would not get past init, which meant I could not boot into pclinuxos anyway - baah!!

It was not worth having an os on a partition that would not boot.  So I netcat'ed lmde from my laptop over the network to replace pclinuxos.  This boots via lilo no problem.

Again thanks..